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

Recommended way of combining rules #733

Closed
Sytten opened this issue Apr 17, 2020 · 4 comments
Closed

Recommended way of combining rules #733

Sytten opened this issue Apr 17, 2020 · 4 comments

Comments

@Sytten
Copy link
Contributor

Sytten commented Apr 17, 2020

Question about GraphQL Shield

Our schema is split between multiple typeDefs files and we use a lot of type extensions. I would like to keep the permissions near that. Either inside a resolver extension (similar to #152, but using ardatan/graphql-tools#1279 and graphql/graphql-js#1527) or as a separate file beside the typeDefs.
My problem is that we need to combine that in some way after it. What is the recommended way to do that?

Thanks!

@Sytten
Copy link
Contributor Author

Sytten commented Apr 21, 2020

So the current work around it to use lodash merge, it works good enough for us but it will not detect duplicate rules. Maybe a util in the library would be useful? @maticzav

@stale
Copy link

stale bot commented Jun 5, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 5, 2020
@stale stale bot closed this as completed Jun 16, 2020
@maticzav
Copy link
Owner

Thank you for your patience with this question.

My thinking is that if you can already do that with other libraries, we don't need new functions per se. If, however, we figure out that there are potential features that can't be achieved without specific "internal" function, we should create a new one.

@Sytten
Copy link
Contributor Author

Sytten commented Jun 16, 2020

Yeah external is fine I guess.

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