Skip to content

Instantly share code, notes, and snippets.

@kylemocode
Created July 10, 2022 14:09
Show Gist options
  • Save kylemocode/3f3f3c9e1db4a39254b162eec30a17b4 to your computer and use it in GitHub Desktop.
Save kylemocode/3f3f3c9e1db4a39254b162eec30a17b4 to your computer and use it in GitHub Desktop.
export const schemaWithMocks = addMocksToSchema({
schema,
mocks,
resolvers: (store) => ({
Query: {
books: (_, { id }) => {
return Array.from(
{ length: 8 },
() => store.get('Book', id)
);
},
},
}),
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment