Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Created September 10, 2021 10:00
Show Gist options
  • Save percybolmer/55b03e5380aa0f537bb9d63d67c15bd8 to your computer and use it in GitHub Desktop.
Save percybolmer/55b03e5380aa0f537bb9d63d67c15bd8 to your computer and use it in GitHub Desktop.
graphql
// generateJobsField will build the GraphQL Field for jobs
func generateJobsField(gs *gopher.GopherService) *graphql.Field {
return &graphql.Field{
// Return a list of Jobs
Type: graphql.NewList(jobType),
Description: "A list of all jobs the gopher had",
Resolve: gs.ResolveJobs,
// Args are the possible arguments.
Args: graphql.FieldConfigArgument{
"company": &graphql.ArgumentConfig{
Type: graphql.String,
},
},
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment