News for hackers. Stuff that matters.
Re:GQless: A GraphQL client built for rapid iteration by linkdd on Tuesday June 01, 2021 @04:36PM (#27360941)
If I understand correctly, it's more like the query (not the schema) is generated from the expected result.

So your application does not need to "talk in GraphQL".

Re:GQless: A GraphQL client built for rapid iteration by millerm on Tuesday June 01, 2021 @04:51PM (#27361109)
The main advantage is that the query is resolved at runtime. It only queries for exactly what your component needs. No over-querying. No sharing queries across components, which is a huge mistake people make.
Re:GQless: A GraphQL client built for rapid iteration by andrewingram on Wednesday June 02, 2021 @09:37AM (#27368524)
I'd say you're broadly right, the key idea is that your client code has a facade over the fact that you're using GraphQL, so it looks cleaner -- it's "just JavaScript". Whether this is an advantage or not is largely down to preference.

The "Why" section in the docs is a pretty good summary:

https://gqless.com/intro#why

"I wanted a GraphQL client that lets you forget you're using GraphQL, whilst tackling some issues shared across all existing GraphQL clients"

The fact that it's resolved at runtime isn't necessarily an advantage, it locks you out of some performance and security patterns. I believe GQLess is investigating support for static extraction of queries at build time.

It's an interesting API, I'm not entirely sold on the idea of disguising the fact that you're using GraphQL though.

Re:GQless: A GraphQL client built for rapid iteration by golergka on Wednesday June 02, 2021 @09:33AM (#27368483)
> query is resolved at runtime

Does it mean that we get errors at runtime and not build time, too?

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.

Re:GQless: A GraphQL client built for rapid iteration by revskill on Wednesday June 02, 2021 @09:51AM (#27368666)
This part is confusing to me.

I prefer this will validate our component for correct schema usage at build time.

Re:GQless: A GraphQL client built for rapid iteration by nwienert on Wednesday June 02, 2021 @10:06AM (#27368832)
It fully typed, so you get errors at build time.
Re:GQless: A GraphQL client built for rapid iteration by coding123 on Wednesday June 02, 2021 @11:44AM (#27370028)
I think the part that's throwing people off (including me) is if I'm looking at that main example, how do I get type completion on this line:

    Hello {query.me.name}!
query dot me dot name should all have type completion. And in most TS "frameworks" you have some way to type hint this all out. us TS folk are not seeing the type hints in the example. Maybe it works in VSCode like that, but totally confused how it does.

Believe me, I'm super interested in this project and it would save a ton of time if it's doing what some of us are hoping :)

Re:GQless: A GraphQL client built for rapid iteration by nwienert on Wednesday June 02, 2021 @01:26PM (#27371457)
It does autocomplete with types on that line, and yes, it’s really that cool.

Disclosure: I funded the development of version 2, and have written a large app using it. I am very happy with it, and believe it’s the best data fetching solution around.

Re:GQless: A GraphQL client built for rapid iteration by atom_arranger on Wednesday June 02, 2021 @07:01PM (#27375084)
The client is generated from the schema, so “query.me.name” is fully typed.