Last active
July 2, 2018 21:29
-
-
Save mhaagens/7ef8b1c270eb7422aa21dfb66631d743 to your computer and use it in GitHub Desktop.
Authentication and authorization using GraphQL Schema Directives: schema.js
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 { gql } = require("apollo-server"); | |
const _ = require("lodash"); | |
const { postDefs, postResolvers } = require("./models/post.js"); | |
module.exports.typeDefs = gql` | |
enum Role { | |
ADMIN | |
USER | |
} | |
type Query { | |
_empty: String | |
} | |
type Mutation { | |
_empty: String | |
} | |
${postDefs} | |
`; | |
module.exports.resolvers = _.merge(postResolvers); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment