Skip to content

Instantly share code, notes, and snippets.

@seandearnaley
Created February 18, 2020 10:01
Show Gist options
  • Save seandearnaley/603aa02fb3fd1f611dbe97a8a9364be6 to your computer and use it in GitHub Desktop.
Save seandearnaley/603aa02fb3fd1f611dbe97a8a9364be6 to your computer and use it in GitHub Desktop.
afterIdLimitPaginatedFieldPolicy
function afterIdLimitPaginatedFieldPolicy<T>() {
return {
merge(existing: T[], incoming: T[], { args, readField }): T[] {
...
},
read(existing: T[], { args, readField }): T[] {
...
},
};
}
const cache = new InMemoryCache({
typePolicies: {
Agenda: {
fields: {
tasks: afterIdLimitPaginatedFieldPolicy<Reference>(),
},
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment