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

Hide directives when their uses are hidden #5163

Merged
merged 2 commits into from
Nov 19, 2024
Merged

Conversation

rmosolgo
Copy link
Owner

Fixes #4882

This adds some hiding of directives when their uses are hidden. It only checks "one level" deep. Directives are hidden if:

  • They aren't registered to the schema with directive(...) configurations
  • AND no types with field(...) configurations using the directive are visible
  • AND no resolvers and fields with argument(...) configurations using the directive are visible
  • AND no enums with value(...) configurations using the directive are visible

It doesn't do recursive checking, so if a type is hidden because fields using it are hidden, then the directive will still be visible. Maybe that's possible but I'm guessing that adding visible? implementations to the app is a less complicated solution in that case.

@rmosolgo rmosolgo added this to the 2.4.5 milestone Nov 18, 2024
@rmosolgo rmosolgo merged commit cc66b4a into master Nov 19, 2024
13 of 15 checks passed
@rmosolgo rmosolgo deleted the directive-visibility branch November 19, 2024 18:58
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

Successfully merging this pull request may close these issues.

2 participants