Skip to content

Not possible to return timestamps!? #1003

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
bradennapier opened this issue Aug 25, 2017 · 3 comments
Closed

Not possible to return timestamps!? #1003

bradennapier opened this issue Aug 25, 2017 · 3 comments

Comments

@bradennapier
Copy link

So it is apparently not possible to handle timestamp values in ms ? Seems completely broken

{
      "message": "Int cannot represent non 32-bit signed integer value: 1503608145148",
      "locations": [
        {
          "line": 5,
          "column": 7
        }
      ],
      "path": [
        "project",
        "events",
        0,
        "timestamp"
      ]
    },

Should there not be some kind of support to handle timestamp values? I would imagine a HUGE amount of api's need this...

@bradennapier
Copy link
Author

Ok, float does work -- but still seems like there needs to be built-in date support.

@wincent
Copy link
Contributor

wincent commented Aug 25, 2017

This is following the GraphQL spec:

Numeric integer values larger than 32‐bit should either use String or a custom‐defined Scalar type, as not all platforms and transports support encoding integer numbers larger than 32‐bit.

So, the answer is to encode this kind of value to string.

As for date support, that is a separate issue: graphql/graphql-spec#315

@psy21d

This comment has been minimized.

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

No branches or pull requests

3 participants