graphql-go
graphql-go copied to clipboard
Add an example of using graphql.ID
Add an example of using graphql.ID. More specifically creating one from an integer and extracting an int value out of it.
All examples must be placed in the /examples/ folder in the root of this project.
👋 Hello!
Do you mind if take this issue? Thanks!
A quick question on the ask for this issue. Looking at the GraphQL spec, it mentions that IDs should always be serialized to a string (http://spec.graphql.org/October2016/#sec-ID). In that case, should we provide examples of how to convert a GraphQL ID to an Integer if the specs recommend converting it to a String? I'd love to get more clarification on this. Thanks!
@ConnieJChi Feel free to add an executable example in example_test.go file in the relay package. Make sure that you use the MarshalID, UnmarshalKind and UnmarshalSpec in your executable examples.