Skip to content

Instantly share code, notes, and snippets.

@piq9117
Last active August 22, 2016 04:37
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 piq9117/64cee784677915edc1da8ffec7ffa383 to your computer and use it in GitHub Desktop.
Save piq9117/64cee784677915edc1da8ffec7ffa383 to your computer and use it in GitHub Desktop.
const MoverInputType = new GraphQLInputObjectType(MoverType);
const Mutation = new GraphQLObjectType({
name: 'Mutation',
description: 'methods to create mover',
fields: () => {
return {
addMover: {
type: MoverType,
args: {
firstName: { type: new GraphQLNonNull(GraphQLString) },
lastName: { type: new GraphQLNonNull(GraphQLString) }
},
resolve: (source, args) => {
return Db.models.mover.create({
firstName: args.firstName,
lastName: args.lastName
});
}
},
addCrew: {
type: new GraphQLList(MoverType),
args: {
type: new GraphQLList(MoverInputType)
},
resolve: (source, args) => {
// no clue how to resolve this yet..
}
}
};
}
});
// I get this error
// Error: Mutation.addCrew(type:) argument type must be Input Type but got: undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment