Core Configuration
The Core Client has some configurations you can set manually:
#
Configurable ClientOptionsName | Type | Default Value | Description |
---|---|---|---|
catchSelectionsTimeMS | number | 10 | Amount of time in milliseconds for the scheduler to wait for grouping data selections together |
retry | RetryOptions | true | Retry on error behavior |
normalization | boolean or NormalizationOptions | true | Enable, disable and configure Normalization |
subscriptionsClient | SubscriptionsClient | undefined | Subscriptions client |
#
Normalizationgqless
has support for normalization
, which helps to reduce data redundancy and improve data integrity across all the cache.
It is enabled
by default, but you can disable it, which will disable the need of automatically fetching __typename
and id's
and all the computing logic needed to support it.
But often enough, it's very useful, and keep in mind that Normalization
in gqless
is highly customizable:
#
IdentifierYou can specify a custom object identifier function.
It gives an incoming object with it's __typename
and it should return:
- A string if successfully identified
- 'null' if it shouldn't be normalized
- Or 'undefined', to fallback to either default or custom
keyFields
#
keyFieldsAuto-fetch & object identifier customization.
Keep in mind that
gqless
already checks your schema and looks for the fields id or __id and it add thems automatically.
Set custom id's of any object type in your schema.
IMPORTANT: Please make sure to only put Scalars
without any variable needed as keyFields