Skip to content

Conversation

@martinbonnin
Copy link
Contributor

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.

# \<name\> — GraphQL Custom Scalar

"Author - \<github user name\> "
"Author - \<github user or organization name\> "
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a follow up from #33

@andimarek
Copy link
Collaborator

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.

@martinbonnin
Copy link
Contributor Author

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.

@martinbonnin
Copy link
Contributor Author

martinbonnin commented Nov 29, 2025

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 ❄️🎶

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants