mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 01:51:40 -05:00
Merge branch 'devel' of https://github.com/VulcanJS/Vulcan into devel
This commit is contained in:
commit
9d3201ccb4
2 changed files with 4 additions and 6 deletions
|
@ -2,7 +2,7 @@ import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { graphql } from 'react-apollo';
|
import { graphql } from 'react-apollo';
|
||||||
import gql from 'graphql-tag';
|
import gql from 'graphql-tag';
|
||||||
import { getSetting, getFragment, getFragmentName, Collections } from 'meteor/vulcan:core';
|
import { getSetting, getFragment, getFragmentName, getCollection } from 'meteor/vulcan:core';
|
||||||
|
|
||||||
export default function withDocument (options) {
|
export default function withDocument (options) {
|
||||||
|
|
||||||
|
@ -10,8 +10,7 @@ export default function withDocument (options) {
|
||||||
queryName = options.queryName || `${collection.options.collectionName}SingleQuery`,
|
queryName = options.queryName || `${collection.options.collectionName}SingleQuery`,
|
||||||
singleResolverName = collection.options.resolvers.single && collection.options.resolvers.single.name;
|
singleResolverName = collection.options.resolvers.single && collection.options.resolvers.single.name;
|
||||||
|
|
||||||
const collection = options.collection
|
const collection = options.collection || getCollection(collectionName);
|
||||||
|| Collections.find(({ options: { collectionName: name }}) => name === collectionName );
|
|
||||||
|
|
||||||
let fragment;
|
let fragment;
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ import React, { Component } from 'react';
|
||||||
import { withApollo, graphql } from 'react-apollo';
|
import { withApollo, graphql } from 'react-apollo';
|
||||||
import gql from 'graphql-tag';
|
import gql from 'graphql-tag';
|
||||||
import update from 'immutability-helper';
|
import update from 'immutability-helper';
|
||||||
import { getSetting, getFragment, getFragmentName, Collections } from 'meteor/vulcan:core';
|
import { getSetting, getFragment, getFragmentName, getCollection } from 'meteor/vulcan:core';
|
||||||
import Mingo from 'mingo';
|
import Mingo from 'mingo';
|
||||||
import compose from 'recompose/compose';
|
import compose from 'recompose/compose';
|
||||||
import withState from 'recompose/withState';
|
import withState from 'recompose/withState';
|
||||||
|
@ -56,8 +56,7 @@ const withList = (options) => {
|
||||||
extraQueries,
|
extraQueries,
|
||||||
} = options;
|
} = options;
|
||||||
|
|
||||||
const collection = options.collection
|
const collection = options.collection || getCollection(collectionName);
|
||||||
|| Collections.find(({ options: { collectionName: name }}) => name === collectionName );
|
|
||||||
|
|
||||||
const queryName = options.queryName || `${collection.options.collectionName}ListQuery`;
|
const queryName = options.queryName || `${collection.options.collectionName}ListQuery`;
|
||||||
const listResolverName = collection.options.resolvers.list && collection.options.resolvers.list.name;
|
const listResolverName = collection.options.resolvers.list && collection.options.resolvers.list.name;
|
||||||
|
|
Loading…
Add table
Reference in a new issue