Change @GraphQLID to only work on strings
See original GitHub issueLibrary Version 1.0.0-RC5
Describe the issue
Our current implementation allows for multiple types to be a ID
:
String
,Int
,Long
orUUID
https://github.com/ExpediaDotCom/graphql-kotlin/wiki/Scalars#id
Expected behavior
According the to GraphQL spec the ID
scalar should always serialize to a String
https://graphql.github.io/graphql-spec/June2018/#sec-ID
Do we need to change this behaviour?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Should I handle a GraphQL ID as a string on the client?
Here's my question. GraphQL seems to treat the ID type as a string. While the ID value gets stored in the MySQL database...
Read more >GraphQL schema basics - Apollo GraphQL Docs
ID (serialized as a String ): A unique identifier that's often used to refetch an object or as the key for a cache....
Read more >Queries and Mutations - GraphQL
On this page, you'll learn in detail about how to query a GraphQL server. Fields#. At its simplest, GraphQL is about asking for...
Read more >Schemas and Types - GraphQL
Most types in your schema will just be normal object types, but there are two types that ... The ID type is serialized...
Read more >Mutations and Input Types - GraphQL
That way, if you modify the data on the server, the client can learn about those modifications. ... id: ID! content: String. author:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If we only had to support strings we could create a new simple class
ID
which can be used instead to be more explicit in the Kotlin code about the resulting schema which means we could remove this annotationExample error that can occur with input if an invalid UUID is given