graphql-helper
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -109,3 +109,3 @@ 'use strict'; | ||
var query = 'mutation ' + capitalized + '($input: ' + inputType + '!) {\n ' + name + '(input: $input) {\n clientMutationId\n ... on ' + payloadType + ' ' + String.raw.apply(String, [target].concat(values)) + '\n }\n } ' + fragmentDefinitions; | ||
var query = 'mutation ' + capitalized + '($input: ' + inputType + '!) {\n payload: ' + name + '(input: $input) {\n clientMutationId\n ... on ' + payloadType + ' ' + String.raw.apply(String, [target].concat(values)) + '\n }\n } ' + fragmentDefinitions; | ||
@@ -115,2 +115,4 @@ var fn = function fn(variables) { | ||
}, variables) | ||
}).then(function (data) { | ||
return Promise.resolve(data.payload); | ||
}); | ||
@@ -117,0 +119,0 @@ }; |
{ | ||
"name": "graphql-helper", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "A simple helper library for making GraphQL queries. For browser usage, ensure that you have a Promise polyfill.", | ||
@@ -5,0 +5,0 @@ "main": "lib.js", |
@@ -239,3 +239,19 @@ # graphql-helper | ||
```js | ||
const paginationPartial = GraphQL.partial ` | ||
edges { | ||
cursor | ||
node { | ||
${Card.fragment} | ||
} | ||
} | ||
pageInfo { | ||
hasNextPage | ||
} | ||
` | ||
const query = GraphQL.query('MyQuery') `{ | ||
topicConnection { | ||
${paginationPartial} | ||
} | ||
}` | ||
``` | ||
@@ -242,0 +258,0 @@ |
@@ -88,3 +88,3 @@ /* @flow */ | ||
const query = `mutation ${capitalized}($input: ${inputType}!) { | ||
${name}(input: $input) { | ||
payload: ${name}(input: $input) { | ||
clientMutationId | ||
@@ -101,3 +101,3 @@ ... on ${payloadType} ${String.raw(target, ...values)} | ||
} | ||
) | ||
).then(data => Promise.resolve(data.payload)) | ||
@@ -104,0 +104,0 @@ fn.queryString = query |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17780
309
283