-
-
Notifications
You must be signed in to change notification settings - Fork 59
Closed
Description
Description:
We use a custom id field _id
and have configured the relay compiler to use this custom field as id. useQuery
hook works fine however when using the usePagination
hook and loadNext
to fetch more items. I see the below error in the graphql response.
message: "Variable '_id' has coerced Null value for NonNull type 'ID!'",…}
Fix
I could fix this locally by changing the id
field in variables to be _id
. We probably want to use identifierField
instead of a fixed key. Something along these lines
paginationVariables.id = identifierValue; // Before
paginationVariables[identifierField] = identifierValue; // After
https://github.com/relay-tools/relay-hooks/blob/master/src/FragmentResolver.ts#L644
Metadata
Metadata
Assignees
Labels
No labels