Last active
January 14, 2018 12:02
-
-
Save marcusstenbeck/77f9e09397bc01d67116ddce7b88709e to your computer and use it in GitHub Desktop.
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 { makeExecutableSchema } = require('graphql-tools'); | |
const gql = require('graphql-tag'); | |
const typeDefs = gql` | |
type Show { | |
title: String! | |
time: String! | |
host: String! | |
location: String! | |
} | |
type Query { | |
allShows: [Show!]! | |
} | |
type Mutation { | |
addShow( | |
title: String! | |
time: DateTime! | |
host: String! | |
location: String! | |
): Boolean | |
} | |
`; | |
module.exports = makeExecutableSchema({ | |
typeDefs, | |
resolvers: { | |
Query: { | |
allShows: () => [] | |
}, | |
Mutation: { | |
addShow: (_, data) => true | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment