Whether the hook should re-render when the network is calling fetchMore
The default value is the same already used for notifyOnNetworkStatusChange
Function that receives the previous data, the result of the query just fetched.
It should return the new data merged with the previous data.
Subset of the original variables of the query
Prepare Query beforehand
Useful for:
Example in Next.js
Gives back the cacheId.
It should be used in the sharedCacheID
option in useQuery
.
Returns only the data type expected from the query function.
It only works as a TypeScript helper, in runtime it's undefined
,
therefore it should only be used with typeof
.
Prepare the query and returns a promise of the data
Gives back the query function.
It should be used in the first parameter of useQuery.
Set the cache data manually
Hydrate the cache in the first mount, preventing network calls.
Shorthand useQuery hook, it only accepts the options
Fully featured hook callback
Query function, it receives the query schema from gqless and the variables, if any.
It should return the data expected from the hook.
Shorthand hook callback, only variables to specify
useQuery hook
useQuery constructor
prepareQuery
useQuery hook
Generated using TypeDoc
fetchMore pagination function
You should specify a subset of the hooks variables which will merge with the specified in the hook options and a updateQuery function that should return the new data hopefully merged with the previous data.
It returns a promise of the resulting merged data and updates the hook data