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

Blacklisting #234

Open
ashleyww93 opened this issue Aug 14, 2023 · 2 comments
Open

Blacklisting #234

ashleyww93 opened this issue Aug 14, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@ashleyww93
Copy link

Describe the problem

I have an API that I am building that has some functions that have no use for external users.

They are restricted via Authentication, but ideally, we wouldn't even want them in the documentation as they can never be called.

I think it would be useful if there was a way to blacklist parts of the schema so that they just are not included in the documentation.

Describe the proposed solution

Ideally, the website configuration would have an area for blacklists, which would support explicit names, wildcards and/or regex matching.

options: {
    blacklist: {
        queries: ["explicitQuery", "queriesWithWildcards*"],
        mutations: [],
        subscriptions: [],
    },
}

Importance

I cannot use Magidoc without it

@ashleyww93 ashleyww93 added the enhancement New feature or request label Aug 14, 2023
@pelletier197
Copy link
Collaborator

Hi! We have considered this feature before, and the feature in itself is not that complex to implement.

Where it gets more complicated is when you have a type used only in a blacklisted query, then your type becomes orphan and it should naturally be excluded from the docs as well, but orphan detection is not that easy to do. That said, this is not strictly required.

I'd you want to dig into it, I'd gladly accept a pull request adding that, it should be relatively straightforward.

@ashleyww93
Copy link
Author

In our case we would only need to blacklist queries or mutations.

It could still be generated (it’s not the end of the world if someone tries to call them, as authentication will block it), but just hidden from the side menu.

Perhaps blacklisting is the wrong word for it, and they could simply be “hidden entities”.

Either way, I’d be happy to give this a try when I have the free time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants