Skip to content

[graphiql] Long scalar is not being deserialized from the GraphQL response accurately. #3010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 4 tasks
srinivasankavitha opened this issue Jan 31, 2023 · 2 comments
Closed
1 of 4 tasks

Comments

@srinivasankavitha
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have the following schema in a Graphql service:

type Query {
    testLong(input: Long): Long
}

For the given query, I expect the input to be returned as is in my data fetcher :

{
    testLong(input: 198372202168701314)
}

I get an incorrect result since the long value is not matching the input:

{
  "data": {
    "testLong": 198372202168701300
  }
}

I have verified that the raw response is in fact correct via curl and by also inspecting the response payload in chrome's developer tools. In GraphiQL, the last 2 digits are displayed incorrectly.

Expected Behavior

The response should be

{
  "data": {
    "testLong": 198372202168701314
  }
}

Steps To Reproduce

No response

Module pattern

  • graphiql-umd
  • graphiql-esm
  • graphiql-commonjs

Environment

- GraphiQL Version:2.3.0
- OS:Mac OS Monterey
- Browser:Chrome
- Bundler:
- `react` Version:
- `graphql` Version:

Anything else?

No response

@acao
Copy link
Member

acao commented Feb 19, 2023

Because Long is not a Scalar that is part of the graphql spec, we would need to implement this as part of #2386

@acao acao closed this as completed Feb 19, 2023
@srinivasankavitha
Copy link
Author

Thanks for the response. Sound good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants