This commit is contained in:
SachaG 2017-04-04 16:28:10 +09:00
parent b42a5af6ed
commit 77187dad17
4 changed files with 5 additions and 2 deletions

View file

@ -11,7 +11,7 @@
}, },
"dependencies": { "dependencies": {
"analytics-node": "^2.1.1", "analytics-node": "^2.1.1",
"apollo-client": "^1.0.0-rc.6", "apollo-client": "^1.0.1",
"babel-runtime": "^6.18.0", "babel-runtime": "^6.18.0",
"bcrypt": "^0.8.7", "bcrypt": "^0.8.7",
"body-parser": "^1.15.2", "body-parser": "^1.15.2",

View file

@ -14,6 +14,7 @@ export default function withDocument (options) {
return graphql(gql` return graphql(gql`
query ${queryName}($documentId: String, $slug: String) { query ${queryName}($documentId: String, $slug: String) {
${singleResolverName}(documentId: $documentId, slug: $slug) { ${singleResolverName}(documentId: $documentId, slug: $slug) {
__typename
...${fragmentName} ...${fragmentName}
} }
} }

View file

@ -76,6 +76,7 @@ const withList = (options) => {
query ${queryName}($terms: JSON) { query ${queryName}($terms: JSON) {
${totalResolverName}(terms: $terms) ${totalResolverName}(terms: $terms)
${listResolverName}(terms: $terms) { ${listResolverName}(terms: $terms) {
__typename
...${fragmentName} ...${fragmentName}
} }
} }

View file

@ -78,7 +78,8 @@ const meteorClientConfig = networkInterfaceConfig => ({
ssrMode: Meteor.isServer, ssrMode: Meteor.isServer,
networkInterface: createMeteorNetworkInterface(networkInterfaceConfig), networkInterface: createMeteorNetworkInterface(networkInterfaceConfig),
queryDeduplication: true, // http://dev.apollodata.com/core/network.html#query-deduplication queryDeduplication: true, // http://dev.apollodata.com/core/network.html#query-deduplication
addTypename: true,
// Default to using Mongo _id, must use _id for queries. // Default to using Mongo _id, must use _id for queries.
dataIdFromObject(result) { dataIdFromObject(result) {
if (result._id && result.__typename) { if (result._id && result.__typename) {