-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improving the documentation #54
Comments
To share some real user thoughts I'm currently hitting while implementing. Where I can't figure out when applyPolicy is even called. I was thinking it would be called anytime a query with the @auth directive on it existed, but I can't seem to get it to fire at all. Edit: Turns out codegen was stripping the directives from the schema, so I was doing things correctly. On that note of docs though, it might be helpful to give a ELI5 difference between the external and directive based options, as well as a plain english descriptions for things, ie. "applyPolicy is run every time..." Some more thoughts here. In the examples we show the directive with a parameter async applyPolicy (authDirectiveAST, parent, args, context, info) {
return context.auth.identity === 'admin'
}, This is hardcoded as === 'admin'. So just glancing, the question I wonder is how does the requires: USER connect to the applyPolicy statement. In this case is Sorry for the ramble, but as a new user these are the things I'm hitting. |
Thanks for the feedback, that's super helpful! :) To summarise your key points:
Would you be interested in helping refine the documentation? |
I'd love to take a stab at it. |
Awesome! Feel free to drop a draft PR in the repo and we can work on it together :) |
@stolinski I was thinking of starting this work later this week, would you be still interested in helping out? |
We should take a look at the Mercurius Auth documentation to make sure it is super clear for new and existing users. We should also make sure it provides everything a developer needs to use and understand Mercurius Auth (without having to look closer at the underlying code/tests for example). Before starting an implementation, it would be great to understand the following:
Keen to hear everyone's thoughts on this!
The text was updated successfully, but these errors were encountered: