简体   繁体   中英

What is the difference between GraphQLJSON and GraphQLJSONObject exported by graphql-type-json?

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM