Created
February 18, 2020 10:01
-
-
Save seandearnaley/603aa02fb3fd1f611dbe97a8a9364be6 to your computer and use it in GitHub Desktop.
afterIdLimitPaginatedFieldPolicy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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