-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
TypeScript errors #8500
Comments
@roiLeo I see that many errors connected with types from GraphQL responses, can I setup codegen? If you're not familiar with it, it's a CLI tool for generating types based on the GraphQL scheme, meaning you don't need to manually write types for each entity. More info is here: https://the-guild.dev/graphql/codegen |
I like zod |
you mean this https://github.com/withshepherd/graphql-codegen-zod? Usually zod is used for validation, I have never seen it used to generate types for graphql. Can you share some example? |
okay this is not related
How will you handle this since:
|
Do we have public link for schema? Or maybe we can fetch it?
The purpose of codegenerating types from a schema is precisely to make it easy to update types after a schema change. In my projects I just run the generate script in the pre-commit hook, or on CI
We can generate types for different schemes In my experience, having type generation from the schema is a must-have, because it greatly improves the readability and reliability of the code. You won't be able to pass wrong variables, you won't be able to access a property that doesn't exist, the code editor will have an autocomplete that shows what variables are passed, and what data comes in. |
If you don't mind I can do Proof of Concept and show how it works |
I know there is somewhere an issue about global (shared) schema between chains may @vikiival give his opinion? |
Replace
All is tracked here. https://github.com/kodadot/loligo/issues
Yup KodaDot currently uses
Let's try for AH* other chains
This is true :) schema change is very hard to track, however if we can manage to cover USv1 it can solve some bugs |
I have understood correctly that this is why you can always get the current fresh scheme at this https://squid.subsquid.io/stick/graphql? |
I noticed that in many files there are TS errors. After
tsc --noEmit
I saw thisI think these errors are worth fixing, also update the types if they are written incorrectly. This will help improve the reliability and predictability of the code
@roiLeo @preschian wdyt?
The text was updated successfully, but these errors were encountered: