Last active
August 22, 2016 04:37
-
-
Save piq9117/64cee784677915edc1da8ffec7ffa383 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
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