Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Created September 12, 2021 06:54
Show Gist options
  • Save percybolmer/ad3e47506918eebfa95fd988e13ec9c8 to your computer and use it in GitHub Desktop.
Save percybolmer/ad3e47506918eebfa95fd988e13ec9c8 to your computer and use it in GitHub Desktop.
graphql
// generateRootMutation will create the root mutation object
func generateRootMutation(gs *gopher.GopherService) *graphql.Object {
mutationFields := graphql.Fields{
// Create a mutation named modifyJob which accepts a JobType
"modifyJob": generateGraphQLField(jobType, gs.MutateJobs, "Modify a job for a gopher", modifyJobArgs),
}
mutationConfig := graphql.ObjectConfig{Name: "RootMutation", Fields: mutationFields}
return graphql.NewObject(mutationConfig)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment