vektah/gqlparser

Add Introspection Description to Scalar Types

Closed this issue · 1 comments

Found that introspection returns empty descriptions for standard types. Not a big issue, but I found it curios why. Found that gqlparser/validator/prelude.graphql uses comments instead of description.

Currently:

# The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
scalar Int

# The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).
scalar Float

# The `String`scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
scalar String

Should be:

"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1."
scalar Int

"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point)."
scalar Float

"The `String`scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text."
scalar String

See: https://facebook.github.io/graphql/June2018/#Description

No particular reason, just an oversight. Should be simple enough to add.