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

Add ability to exclude schema members from the generated docs #140

Open
Fs00 opened this issue Mar 13, 2023 · 1 comment
Open

Add ability to exclude schema members from the generated docs #140

Fs00 opened this issue Mar 13, 2023 · 1 comment

Comments

@Fs00
Copy link

Fs00 commented Mar 13, 2023

Is your feature request related to a problem? Please describe.
When generating the docs for a graphql-ruby schema, the resulting documentation includes types used for introspection such as __Type, __Field, __Directive etc. which I'd rather not have in my API documentation.
Also, I might want to hide some mutations, fields or types in the docs because I use them for internal purposes and I don't want other clients to rely on them (I know that ideally I should hide them in the schema itself, but it's not always convenient or desirable).

Describe the solution you'd like
I envision an option similar to the notices one: a user-provided proc that, given the schema member path, returns true if the member should be hidden.
To satisfy the use-case described above, one could write the option as: (feel free to choose a different/better name for the option)

options[:hide_if] = ->(schema_member_path) { schema_member_path.start_with?('__') }
@brettchalupa
Copy link
Owner

@Fs00 Makes sense to me, thanks for logging this! Seems like a worthwhile improvement. Not sure if I'll be able to dig into it soon, but it's certainly open for others to take on if they want. 👍

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

No branches or pull requests

2 participants