Skip to content

Instantly share code, notes, and snippets.

@marcusstenbeck
Last active January 14, 2018 12:02
Show Gist options
  • Save marcusstenbeck/77f9e09397bc01d67116ddce7b88709e to your computer and use it in GitHub Desktop.
Save marcusstenbeck/77f9e09397bc01d67116ddce7b88709e to your computer and use it in GitHub Desktop.
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