event.context.auth is null for operationBefore, operationAfter and subscriptions even when providing a valid Authorization header. #317
Description
Issue by meikoudras
Friday Oct 20, 2017 at 10:26 GMT
Originally opened as https://github.com/graphcool/prisma/issues/955
Current behavior
event.context.auth is null for operationBefore, operationAfter even when providing a valid Authorization header.
Reproduction
Example project
https://github.com/meikoudras/test-auth
Create a new user.
Select the user in playground.
Run in playground:
mutation ($id:ID!, $name:String!) { updateUser(id: $id, name:$name) { id name } }
This will return an error "no auth" - that means the auth property in event.context is null.
Run a resolver with the same user:
query { testAuth(a: 1, b: 1) { sum } }
This will pass as the auth property is defined.
Expected behavior?
That all functions have an event.context.auth set when an authorization header is present.