Open
Description
I've just been to the GraphQL Europe conference and it got me thinking about how we specify resolvers. Using Go methods seemed nice at first, but is that really the best way? Please take a look at this alternative:
https://github.com/neelance/graphql-go/blob/new-resolvers/example/starwars/starwars.go#L291
Advantages:
- no resolver wrappers, especially good for list results
- API easier to learn
- clean shortcuts like
ResolverField
- most type checking at startup is still possible
- explicit name mapping between GraphQL and Go
- automatic handling of GraphQL type assertions
Disadvanatages:
- no type checking on return value if type is a GraphQL interface (they map to Go's
interface{}
)
What do you think?
Metadata
Metadata
Assignees
Labels
No labels