Core Configuration
The Core Client has some configurations you can set manually:
ClientOptions#
| Name | 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 | booleanorNormalizationOptions | true | Enable, disable and configure Normalization | 
| subscriptionsClient | SubscriptionsClient | undefined | Subscriptions client | 
RetryOptions#
By default GQless has a retry policy of 3 max retries, with a delay of a standard back-off delay (attemptIndex) => Math.min(1000 * 2 ** attemptIndex, 30000) ms.
You can customize it this way:
- retry = falseto disable it.
- retry = 6it will retry failing requests- 6times, with the standard back-off delay.
- retry = trueto use the default- 3max retries, with a delay of standard, a back-off delay.
- { maxRetries: 6, retryDelay: 2000 }for- 6max retries, with flat 2000ms of delay per retry.
- { retryDelay: function customRetryDelay(attemptIndex) { ... } }for- 3max retries with custom back-off delay, and so on...
Normalization#
GQless 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:
Identifier#
You 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
keyFields#
Auto-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