-
Notifications
You must be signed in to change notification settings - Fork 106
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
Implement TypedDocumentNode support (with type-safe variables) #275
base: master
Are you sure you want to change the base?
Conversation
5722f71
to
f624644
Compare
Just noticed that this is based on an older version and the variable subsystem has seen significant work 😢 Would you be open to considering an approach like this which works with automatic inference, without explicitly specifying the variables and their types before hand? |
Don't worry new variable system is almost same as the old one I can help with rewriting your PR to the new variable system |
The thing I'm not sure about is that the old system would traverse and discover variables and their types and the new one doesn't appear to do that anymore - unless I'm missing it somehow? The |
Ok it is much easier than expected in 5.0.0. I will publish PR with TypedQueryDocumentNode today so you can review |
#279 Can you take a look on this? I think it solves the problem |
Hi @aexol unfortunately this doesn't solve the problem for me, for two reasons:
The v4.0 solution I came up with infers all types fully automatically with no need to specify them upfront - while still remaining type-safe. Would you be open to reconsider the |
if it is just about inferring the type without specifying it I can do it |
I'm not sure what you mean - would there still be To be more specific, the full list of
Is it really necessary to have |
Yes we can go back to the old way, but with a more clever approach now. |
I made it in |
I will bump this. I totally agree with @spion that specifying the input type is really error prone and should be automatically inferred (with help of the introduced scalars). If I have an query with |
Sorry @aexol looks like I forgot to reply to this thread. I decided to go in a different direction. I quite liked the I want to properly credit zeus though, I learned some cool clever tricks for the implementation to reduce compilation size compared to |
I took at stab at fully implementing #235 and while complex this approach seems to work quite well.
I tried to cover everything in this PR (including docs) however do let me know if I've missed something.