question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change @GraphQLID to only work on strings

See original GitHub issue

Library Version 1.0.0-RC5

Describe the issue Our current implementation allows for multiple types to be a ID:

  • String, Int, Long or UUID

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:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
smyrickcommented, Sep 5, 2019

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 annotation

0reactions
smyrickcommented, Sep 17, 2019

Example error that can occur with input if an invalid UUID is given

Screen Shot 2019-09-17 at 11 48 38 AM

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found