Skip to main content

Frequently asked questions

How does it work?#

gqless creates an object using information from your schema. Accessing new properties adds them to the current "commit". GraphQL queries are then generated every few milliseconds.

The response from the query is merged into the cache. Now when you access the same properties again, the newly fetched values are returned.

All scalars can be undefined?#

For gqless to be able to work, in the first pass of your data usage, every GraphQL Scalar and Enum is returned as undefined, after that, the data requirement is acknowledged by gqless, and when the data arrives from the GraphQL API, it returns the new value instead.

We will often call them Skeleton value.

One important thing to note is that the "Skeleton value" is different than null (which was used in the early designs), which allows you differentiate between when it's a "Skeleton value" or an actual null coming from the API, and it also allows you to easily set default values to replace only the "Skeleton value" while destructuring.

How will it affect bundle size?#

In the code-generated files, an object representation of the schema is outputted - negligible for most apps. This could be optimized in the future by stripping out unused parts.

The gqless packages are lightweight and don't require external dependencies.

How fast is it?#

Very fast, gqless's architecture was designed with performance in mind. Unlike other clients, queries are generated directly - instead of outputting intermediate AST.

Last updated on by Sam Denty