Skip to content

Instantly share code, notes, and snippets.

@xoor-io
Created June 12, 2018 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xoor-io/181beb88ffc9f66fbac1dac928f143aa to your computer and use it in GitHub Desktop.
Save xoor-io/181beb88ffc9f66fbac1dac928f143aa to your computer and use it in GitHub Desktop.
graphql-query
const Query = `
extend type Query {
books: [Book]
}
`;
export const queryTypes = () => [Query];
export const queryResolvers = {
Query: {
books: () => ([
{
title: "Harry Potter and the Sorcerer's stone",
author: 'J.K. Rowling',
},
{
title: 'Jurassic Park',
author: 'Michael Crichton',
},
])
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment