INNER CODE UNIT · TypeScript
getIdField
microsoft/graphitation · packages/apollo-forest-run/compat/src/core/__tests__/QueryManager/index.ts:1476
const getIdField = ({ id }: { id: string }) => id;
itAsync('runs a mutation with object parameters and puts the result in the store', (resolve, reject) => {
const data = {
makeListPrivate: {
id: '5',
isPrivate: true,
},
};
// ForestRun: doesn't cache mutation results by default. They must be explicitly marked as cacheable.
return mockMutation({
reject,
mutation: gql`
mutation makeListPrivate @cache {
makeListPrivate(input: { id: "5" }) {
id
isPrivate
}