Skip to content
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

Shield rules type generation based on schema #1503

Open
lukadriel7 opened this issue Dec 18, 2022 · 1 comment
Open

Shield rules type generation based on schema #1503

lukadriel7 opened this issue Dec 18, 2022 · 1 comment

Comments

@lukadriel7
Copy link

Feature request

Is your feature request related to a problem? Please describe

Currently, one has to write the schema rule without any intellisense for the schema types. With bigger schema, it can be easy to forget writting rules for specific fields, mutation or query.

Describe the solution you'd like

The possibility to generate a fully typed permission schema based on the user's graphql schema using graphql-codegen.

Describe alternatives you've considered

The way I currently implement is using deny as a fallback rule and implement the rules for the schema from there. Unfortunately It is easy to forget some part of the schema and find out only when testing.

@omar-dulaimi
Copy link

omar-dulaimi commented Jan 1, 2023

Hey @lukadriel7
Check this project out https://github.com/omar-dulaimi/graphql-shield-generator
It could help you generate the shield automatically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants