neo4j-graphql-js icon indicating copy to clipboard operation
neo4j-graphql-js copied to clipboard

Selective auth for autogenerated queries and mutations

Open psamaan opened this issue 6 years ago • 2 comments

I may be missing something obvious, but I can't seem to find a way in the examples or docs to allow anonymous access to autogenerated queries or mutations.

I am trying to use authorization schema directives by enabling auth in makeAugmentedSchema as per the docs: https://grandstack.io/docs/neo4j-graphql-js-api.html#makeaugmentedschemaoptions-graphqlschema Now for queries and mutations I define in my typeDefs I still can have unauthenticated queries or mutations if I leave out the isAuthenticated directive, however calling any autogenerated query gives me a "AuthorizationError: No authorization token." error.

What I need is to be able to enforce authentication, scope, and role presence on some autogenerated queries/mutations but not others, possibly via an exclude property in the auth part of the config object similar to that supplied to query and mutation?

P.S. Thank you for the awesome project!

psamaan avatar Mar 15 '19 04:03 psamaan

Good question. What's the status on this now?

manonthemat avatar Dec 07 '20 19:12 manonthemat

https://github.com/neo4j-graphql/neo4j-graphql-js/issues/608

michaeldgraham avatar May 02 '21 04:05 michaeldgraham