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

Discussion: Custom scalars support #17

Open
JoviDeCroock opened this issue Nov 30, 2023 · 1 comment
Open

Discussion: Custom scalars support #17

JoviDeCroock opened this issue Nov 30, 2023 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@JoviDeCroock
Copy link
Member

JoviDeCroock commented Nov 30, 2023

Summary

We need to support custom-scalars, this currently has a bit of a roadblock with regards to the schema-builder where it will expect the custom scalars to be present on the generic or it won't know how to type them. Maybe we can be clever and tell TypeScript that anything we don't know how to type should be unknown or any but that does loosen our strict-typings.

We would then need to extend the custom scalars to the configuration in our codegen, it's possible that they are automatically picked up and case to unknown but ideally the user is enabled to type these themselves.

@JoviDeCroock JoviDeCroock added the enhancement New feature or request label Nov 30, 2023
@JoviDeCroock
Copy link
Member Author

JoviDeCroock commented Dec 22, 2023

We'll probably be able to support this similar to #107 with overriding the global-type so something along the lines of BaseScalars & UserScalars.

On top of that we export some scalarType helper for folks to add their own scalars, in the docs we should document that we added JSON and DateTime for our consumers and link to common scalars like GraphQL-Scalars.

One thing that we still need to think about is how we'll integrate this with codegen, this could be a follow-up issue though, i.e. it could be part of a configuration file like the graphql-config file.

EDIT: the above becomes less of an issue with gql.tada as folks can add the types for the scalars themselves in the fuse/tada.ts file, we should ensure that we don't override this file.

@JoviDeCroock JoviDeCroock added the good first issue Good for newcomers label Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant