This repository was archived by the owner on Mar 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
Relay Modern API notes
Eloy Durán edited this page Sep 15, 2017
·
1 revision
These are areas we ran into where the docs are lacking:
-
container:
- setting default variable values (use
@argumentDefinitions) - fields used in different fragments with different arguments lead to a clash, Relay no longer seems to automatically alias those fields like it did in Classic mode, so you need to manually alias those
- setting default variable values (use
-
refetch container:
- passing arguments for parameters defined with
@argumentDefinitions(use `@arguments)
- passing arguments for parameters defined with
-
pagination container:
- setting the initial page size (use
@argumentDefinitionsto set default values, although that still means you may need to repeat the count constant in both JS code and the GraphQL fragment) - what the purpose of the various functions is (e.g.
getFragmentVariablesvsgetVariablesetc)
- setting the initial page size (use
-
mutations:
- For connections, still need to provide a mutation ‘config’, but it’s no longer used to append/prepend a new record to the prop and used to re-render, only for how to update the store, I think? Instead we now have to use the imperative API to trigger a UI update.