News for hackers. Stuff that matters.
Re:Show HN: Game Changing Typed GraphQL by brainbag on Thursday January 20, 2022 @09:34AM (#30009372)
Looks nice. How does it compare to graphql-code-generator? I've been using that tool for years and I'm happy with it, but always glad for improved tools.
Re:Show HN: Game Changing Typed GraphQL by throwthere on Thursday January 20, 2022 @09:57AM (#30009649)
Same here. I’ve tried Apollo but switched to react query and graphql codegen. Probably not going to switch again without reason— would be interesting to see the differences. Title is a little off putting because it sounds like there’s a little precooked bias
Re:Show HN: Game Changing Typed GraphQL by aexol on Thursday January 20, 2022 @10:14AM (#30009865)
I integrated react-query with zeus so you can try it together with integration
Re:Show HN: Game Changing Typed GraphQL by aexol on Thursday January 20, 2022 @10:06AM (#30009765)
Just generate one lib. then write type safe queries inside IDE
Re:Show HN: Game Changing Typed GraphQL by arcticfox on Thursday January 20, 2022 @10:14AM (#30009860)
https://hasura.io/blog/your-guide-to-graphql-with-typescript...

So I guess this is a recommended option from Hasura to generate typed API bindings; I was going to try following that tutorial at some point, looks pretty slick.

Am I understanding correctly that this tool works with something like Hasura (GraphQL backend) to generate an API schema / query client that can be used with something like react-query to retrieve data?

Re:Show HN: Game Changing Typed GraphQL by aexol on Thursday January 20, 2022 @10:29AM (#30010057)
yes
Re:Show HN: Game Changing Typed GraphQL by aexol on Thursday January 20, 2022 @08:45AM (#30008778)
Why I am posting this? 2 reasons: GraphQL Zeus reached 4.0 and is compatible with huuge schemas, second reason I received a great contribution with full readme rewrite and I packaged it into docs site
Re:Show HN: Game Changing Typed GraphQL by Sytten on Thursday January 20, 2022 @09:55AM (#30009616)
Not a fan of uselessly sensational titles, but will give it a try. Currently using urql and codegen that already handle that pretty well. What is your edge?
Re:Show HN: Game Changing Typed GraphQL by aexol on Thursday January 20, 2022 @10:05AM (#30009745)
I plan to integrate urql. I generate the whole lib with complicated generic types, so you don't have to write gql queries and run codegen. Just generate once and write interactive queries. No watching and stuff
Re:Show HN: Game Changing Typed GraphQL by nvegater on Thursday January 20, 2022 @03:46PM (#30014676)
Any time horizon ? 1 year ? 6 months ?
Re:Show HN: Game Changing Typed GraphQL by aexol on Friday January 21, 2022 @04:15AM (#30021069)
Dunno, if you ping me I can do next week
Re:Show HN: Game Changing Typed GraphQL by antholeole on Friday January 21, 2022 @09:29AM (#30023919)
Something I’ve been wondering: does graphQL Zeus increase code size as schema grows? I get that there’s a constant code size for the package, but I’m running on cloudflare workers for some processes, and scripts have a limit of 1MB. I’m using Hasura, so the gql schema is quite large. I’d like to switch over to Zeus for typings, but I’m worried it’ll push me over the 1MB limit.
Re:Show HN: Game Changing Typed GraphQL by aexol on Friday January 21, 2022 @10:08AM (#30024484)
how big is your schema then? Of course code grows as schema grows as it is translated to TS. However productivity boost is huge.

If you want to use it with bigger than 1mb schemas create an issue , maybe we can split it to more files if that works for this limit

Re:Show HN: Game Changing Typed GraphQL by antholeole on Friday January 21, 2022 @04:51PM (#30030462)
Not sure about “of course” - TS gets erased at runtime, so while “of course” it’ll increase the pre-compiled code size, it’s not so easy post compile.

If you weren’t aware, you can’t run TS directly - you have to compile it to JS for execution

Re:Show HN: Game Changing Typed GraphQL by gvkhna on Thursday January 20, 2022 @10:28AM (#30010037)
What’s the difference between this and react relay, which generates typescript types for Graphql queries?
Re:Show HN: Game Changing Typed GraphQL by aexol on Thursday January 20, 2022 @10:29AM (#30010051)
I replied below
Re:Show HN: Game Changing Typed GraphQL by motoxpro on Friday January 21, 2022 @02:55AM (#30020491)
Where?
Re:Show HN: Game Changing Typed GraphQL by aexol on Friday January 21, 2022 @04:12AM (#30021046)
above now :). I can do it again. Zeus allows you to generate client library from schema - not from queries. Then you can write queries in TS, you will receive: - typed args - typed response

It also offers selectors from which you can create typings for your response objects if you are persisting those somewhere in state, so yeah it is a game changer not only for GraphQL, but for communication with backend and Frontend developer experience.

To be honest it has also some cons, for example: - variables are custom implementation and don't have typings as for now - some edge cases are not supported yet

Here are full docs: https://zeus.graphqleditor.com/