Skip to content

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

Description

@Fs00

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?('__') }

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions