News for hackers. Stuff that matters.
Re:GQless: A GraphQL client built for rapid iteration by SketchySeaBeast on Wednesday June 02, 2021 @09:50AM (#27368655)
Have you found a way to get build errors with GraphQL queries? I only ever get them during runtime when the request is made, I assume because that's the point at which the back-end and front-end disagree on what you're requesting.
Re:GQless: A GraphQL client built for rapid iteration by potatoz2 on Wednesday June 02, 2021 @11:18AM (#27369699)
If you generate types from your GraphQL queries, they are validated against the schema at that time (so you'd get schema errors then, of course there can still be network errors, server errors or user/semantic errors at runtime)
Re:GQless: A GraphQL client built for rapid iteration by nawgz on Wednesday June 02, 2021 @01:26PM (#27371458)
Using Typescript,GraphQL-codegen, and Hasura, I can build correct-by-construction React apps. GraphQL-codegen & Hasura introspect the DB to type the query result, and typescript confirms my JS is not accessing any of those fields illegally.

It’s pretty killer to open GraphiQL, write a new query, drop it into a graphql file in my repo, rerun the codegen, and be able to have type safe operations on the queried data.

Also makes me completely unsure why anyone would want what the OP is but that’s ok

Re:GQless: A GraphQL client built for rapid iteration by atom_arranger on Wednesday June 02, 2021 @06:59PM (#27375070)
This solution seems to work like this:

  - Generate type safe client based on your schema.
  - Access GraphQL properties as if they were just JS object properties.
So in this solution the codegen step comes before writing a query.

You get the same advantages pretty much, and you have less likelihood of querying for unused data.