-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
Using the AST provided by the library, I'm doing some introspection on the queries to extract the default values passed in to a query.
I noticed that the IntValueNode and FloatValueNode types both use string to store the value instead of number.
graphql-js/src/language/ast.ts
Lines 478 to 482 in 2aedf25
| export interface IntValueNode { | |
| readonly kind: Kind.INT; | |
| readonly loc?: Location | undefined; | |
| readonly value: string; | |
| } |
graphql-js/src/language/ast.ts
Lines 484 to 488 in 2aedf25
| export interface FloatValueNode { | |
| readonly kind: Kind.FLOAT; | |
| readonly loc?: Location | undefined; | |
| readonly value: string; | |
| } |
This seems a bit counter-intuitive to me, and would require me to write some custom parsing code on top of the existing parsing that graphql-js does.
Is this an intentional decision to store the values in a string instead of a number, or is it something that should be changed?
Metadata
Metadata
Assignees
Labels
No labels