3

From the official package documentation:

GraphQLJSON can represent any JSON-serializable value, including scalars, arrays, and objects. GraphQLJSONObject represents specifically JSON objects, which covers many practical use cases for JSON scalars.

It sounds a bit confusing as to me both definitions seem quite similar. Can someone please help me understand this better with an example? Thanks in anticipation.

https://www.npmjs.com/package/graphql-type-json

shet_tayyy
  • 5,366
  • 11
  • 44
  • 82

1 Answers1

4

JSON value can be of type string, number, boolean, object, array or null. So GraphQLJSON represents any of this, while GraphQLJSONObject represents JSON objects exclusively.