Last active
October 12, 2015 03:30
-
-
Save nickretallack/cfd7c27d57b65c06fbf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"errors": [ | |
{ | |
"message": "Argument \"input\" expected type \"UploadFileByUrlInput!\" but got: {url: foo}.", | |
"locations": [ | |
{ | |
"line": 1, | |
"column": 35 | |
} | |
] | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl localhost:4001 -H 'Content-Type: application/graphql' -d 'mutation M{uploadFileByUrl(input: {url: 'foo'}) { clientMutationId } }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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