graphql-zeus icon indicating copy to clipboard operation
graphql-zeus copied to clipboard

Version 5 lost the auto detection of the variables types

Open Nico924 opened this issue 10 months ago • 3 comments

I am using grapql-zeus since a long time now but sticked to version 4 because with version 4 I was not obligated to put the variable type with the $ operator. Now with version 5 I see that we have to put the variable type as well like this : Zeus('query', { myFunc: [{ input: $('input','InputType!) }, outputModel ] })

With version 4 I was able to do : Zeus('query', { myFunc: [{ input: $('input') }, outputModel ] })

And InputType! was automatically detected.

Is it intended ? Is there a workaround ?

Thank you in advance for you answer

Nico924 avatar Mar 29 '24 13:03 Nico924

This is intended as I don't have time to reimplement those. Right now the best way to use zeus is to use typedDocumentNode output with some other lib like apollo. Then it works great with variables. My idea is to write a simple fetch client that consumes typeddocumentnode some day

aexol avatar Apr 04 '24 08:04 aexol

Adding to what @aexol mentioned, I've been using typedDocumentNode for the last weeks in tandem with urql and so far it's worked great for that matter, in fact it is very straightforward and very little (or zero even) extra code.

heliosam avatar Apr 04 '24 15:04 heliosam

I will add default fetcher with typedDocumentNode so it should solve a problem.

aexol avatar Oct 18 '24 13:10 aexol