Created
September 10, 2021 10:00
-
-
Save percybolmer/55b03e5380aa0f537bb9d63d67c15bd8 to your computer and use it in GitHub Desktop.
graphql
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
// 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