Conversation
| # \<name\> — GraphQL Custom Scalar | ||
|
|
||
| "Author - \<github user name\> " | ||
| "Author - \<github user or organization name\> " |
|
This is deliberately saying JSON. 😀 A Scalar spec is currently tied to JSON and you can only define really a Scalar for JSON because the core GraphQL spec only specifies its behavior in respect to JSON and no other transport protocol. So in order to have custom Scalar specs which are valid for other transport protocols you have to define first how GraphQL itself works for these other protocols. |
|
So "GraphQL does not require a specific serialization format" but if you use something else than JSON then behaviour is unspecified 😅 This is such a pain... I think the GraphQL spec should mandate somewhere that the serialization format supports object, list, string, number and boolean. Oh well... I'll make another PR to hightlight that JSON is "one of" the possible serialization format. |
Never mind, just trying to re-read my own PRs gives me a head ache. Looks like we need to clarify all of this in the main spec repo before we can get clarity here. Alas I want to focus on nullability for the time being so I'll just let it go ❄️🎶 |
GraphQL is transport agnostic and can be used on other formats than JSON (cbor, etc..).
I replaced "JSON" with "external value", which is the closest IMO?
All in all, there is some ambiguity in the GraphQL spec itself (see also graphql/graphql-js#3065). This is not perfect but I believe this is more correct than assuming JSON.