Skip to content

Instantly share code, notes, and snippets.

@nickretallack
Last active October 12, 2015 03:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickretallack/cfd7c27d57b65c06fbf9 to your computer and use it in GitHub Desktop.
Save nickretallack/cfd7c27d57b65c06fbf9 to your computer and use it in GitHub Desktop.
{
"errors": [
{
"message": "Argument \"input\" expected type \"UploadFileByUrlInput!\" but got: {url: foo}.",
"locations": [
{
"line": 1,
"column": 35
}
]
}
]
curl localhost:4001 -H 'Content-Type: application/graphql' -d 'mutation M{uploadFileByUrl(input: {url: 'foo'}) { clientMutationId } }'
var UploadFileByUrlMutation = mutationWithClientMutationId({
name: 'UploadFileByUrl',
inputFields: {
url: {
type: new GraphQLNonNull(GraphQLString),
},
},
outputFields: {
file: {
type: fileType,
resolve: (payload) => payload,
},
viewer: {
type: viewerType,
resolve: getViewer,
}
},
mutateAndGetPayload: uploadFileByUrl,
})
var mutationType = new GraphQLObjectType({
name: 'Mutation',
fields: () => ({
uploadFileByUrl: UploadFileByUrlMutation
})
});
export var Schema = new GraphQLSchema({
query: queryType,
mutation: mutationType
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment