Last active
October 13, 2016 14:23
-
-
Save nwillc/a66829bc83295122513b741d71a71105 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
return newObject() | |
.name("mutation") | |
.field(newFieldDefinition() | |
.name("category") | |
.type(new GraphQLTypeReference("category")) | |
.argument(newArgument() | |
.name("key") | |
.type(new GraphQLNonNull(GraphQLString)) | |
.build()) | |
.argument(newArgument() | |
.name("name") | |
.type(new GraphQLNonNull(GraphQLString)) | |
.build()) | |
.dataFetcher(env -> { | |
Category category = new Category(env.getArgument("key"), | |
env.getArgument("name")); | |
categoryDao.save(category); | |
return category; | |
}) | |
.build()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment