maticzav / graphql-shield

🛡 A GraphQL tool to ease the creation of permission layer.
https://graphql-shield.com
MIT License
3.56k stars 172 forks source link

Shield rules type generation based on schema #1503

Open lukadriel7 opened 1 year ago

lukadriel7 commented 1 year ago

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 commented 1 year ago

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