Created
June 12, 2018 14:11
-
-
Save xoor-io/181beb88ffc9f66fbac1dac928f143aa to your computer and use it in GitHub Desktop.
graphql-query
This file contains 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
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