You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have three categories of features and problems that have come up repeatedly and have a potentially common solution:
When using relayPagination/simplePagination/custom resolvers that merge fields, it's impossible to tell when these resolvers should actually be not used
if a paginated field is used for infinite pagination and regular pagination, and both happen in the same query, they conflict.
if a paginated field shouldn't be infinitely paginated in another query, a custom wrapper must be written around the helpers to prevent this manually
We have considered the addition of @required and @optional directives, which “preempt” the support for nullability operators on the client-side, and are an alternative to schema awareness
They further become more important when we consider future scenarios where fragments may be partially loading, while the full query has only partially resolved against the cache
We could consider solving these problems in one go by adding custom directive support to Graphcache. With custom directives, instead of adding additional “switching/toggling” logic to Graphcache, we make potentially arbitrary resolvers configurable.
e.g. relayPagination could be included as an @relayPagination directive.
Summary
We have three categories of features and problems that have come up repeatedly and have a potentially common solution:
relayPagination
/simplePagination
/custom resolvers that merge fields, it's impossible to tell when these resolvers should actually be not used@required
and@optional
directives, which “preempt” the support for nullability operators on the client-side, and are an alternative to schema awarenessWe could consider solving these problems in one go by adding custom directive support to Graphcache. With custom directives, instead of adding additional “switching/toggling” logic to Graphcache, we make potentially arbitrary resolvers configurable.
e.g.
relayPagination
could be included as an@relayPagination
directive.Proposed Solution
Some questions that require further consdieration (TBD):
resolvers
?cache.resolve(parent, info.parentFieldKey)
?@required
and@optional
feasibly implemented as a resolver?Requirements
TBD
The text was updated successfully, but these errors were encountered: