Skip to content

Typescript server compilation error for graphql.scalar #362

Answered by kitten
Shishouille asked this question in Q&A
Discussion options

You must be logged in to vote

It's hard to tell what causes this, to be honest, without a reproduction. Make sure you're outputting the introspection file in the optimised .d.ts format. Especially if it's only happening sometimes then that's a little odd.

I'd recommend to make sure that graphql.scalar is not itself also used in recursive types. I can see that you've got it in some kind of array there, but if you're passing that array to, say, Zod, that will just deepen the types for TypeScript and make it more likely that you hit the recursion limit, if there's no boundary between their types and gql.tada's types.

Regarding enum values, there's several threads on this here and on our Discord.

In short,…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Shishouille
Comment options

Answer selected by Shishouille
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants