-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Fix/8754 disable graphql queries other than crud #9131
Fix/8754 disable graphql queries other than crud #9131
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9131 +/- ##
===========================================
+ Coverage 34.64% 54.87% +20.23%
===========================================
Files 1308 133 -1175
Lines 14431 4304 -10127
Branches 1432 871 -561
===========================================
- Hits 5000 2362 -2638
+ Misses 8517 1526 -6991
+ Partials 914 416 -498
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
return methodString.match(regex)[0]; | ||
}; | ||
|
||
const removeDisabledResolvers = (mutationOrQueryDef, disabledResolvers) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like on that string processing could be avoided by using a schema transform on the makeExecutableSchema instead :) this would make it more powerfull too :) inspiration https://www.advancedgraphql.com/content/schema-transformation.
What do you think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes good one! i'll update the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI you should use @graphql-tools for this :) they have a lot of utilities to do that
…x/8754-disable-graphql-queries-other-than-CRUD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you for this improvement
Thanks for implementing that fix, guys! 💚 |
This pull request has been mentioned on Strapi Community Forum. There might be relevant details there: |
What does it do?
Fixes disabling queries and mutations other than the ones created by the ShadowCRUD. Example: register, forgotPassword, resetPassword, emailConfirmation etc. can be disabled now.
Why is it needed?
We want to hide them in the generated graphql-schema.
Related issue(s)/PR(s)
#8754
#8845