The "Why" section in the docs is a pretty good summary:
"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.
Does it mean that we get errors at runtime and not build time, too?
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
- 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.
I prefer this will validate our component for correct schema usage at build time.
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 :)
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.
So your application does not need to "talk in GraphQL".