A smallish library for easily creating auth with a schema directive
- node >= 8.X
- apollo-server >= 2.6.X
authDirective
args:
- validatorFunction (function, required) - the function to run on incoming requests. Returns a boolean. Has two arguments:
- context: (object) - apollo-server context object
- validAccess (array) - the list of valid access levels (i.e. roles or permissions)
authDirectiveTypeDef
- An gql object containing the the typedef for the schema directive
For an example implementation please consult the sandbox file