Skip to content

Instantly share code, notes, and snippets.

@mhaagens
Last active July 2, 2018 21:29
Show Gist options
  • Save mhaagens/7ef8b1c270eb7422aa21dfb66631d743 to your computer and use it in GitHub Desktop.
Save mhaagens/7ef8b1c270eb7422aa21dfb66631d743 to your computer and use it in GitHub Desktop.
Authentication and authorization using GraphQL Schema Directives: schema.js
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