Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow built in scalar overrides #713

Open
obmarg opened this issue Jun 11, 2023 · 0 comments
Open

Allow built in scalar overrides #713

obmarg opened this issue Jun 11, 2023 · 0 comments
Labels
breaking A breaking change ✨ enhancement New feature or request
Milestone

Comments

@obmarg
Copy link
Owner

obmarg commented Jun 11, 2023

#711 highlighted that some GraphQL servers don't stick precisely to the spec, particularly around integers.

It's currently possible to work around this with newtypes, but I would like users to be able to just declare that i64 is acceptable in Int position. Similarly, if someone wants to use an alternative type in place of String (SmolStr for example) that should be possible.

The main obstacle to this is that we use built in types as type markers for these, so the orphan rule prevents you from doing impl IsScalar<i32> for any types that you don't own. If we updated the schema to output dedicated type markers for all the built in scalars that should make this possible.

Technically a breaking change, but probably not one that would affect most users.

Also want to make sure to document this when I get to it.

@obmarg obmarg added this to the 4.0.0 milestone Jun 11, 2023
@obmarg obmarg added the ✨ enhancement New feature or request label Jun 11, 2023
@obmarg obmarg added the breaking A breaking change label Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking A breaking change ✨ enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant