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

[graphiql] feat: add more root types in schema documentation #3309

Open
markbenliyan opened this issue Jul 1, 2023 · 4 comments
Open

[graphiql] feat: add more root types in schema documentation #3309

markbenliyan opened this issue Jul 1, 2023 · 4 comments

Comments

@markbenliyan
Copy link

markbenliyan commented Jul 1, 2023

Would be awesome to be able to add some more "parent" types to the SchemaDocumentation component, the way we have query mutation and subscription.

My schema currently has a _typemap which gets displayed in the All Schema Types though the ability to categorize that would be great, like in the example below. These map to the exisiting GraphQL types like
GraphQLObjectType GraphQLEnumType``GraphQLInputObjectType etc.

Essentially I'd like a feature where we can categorize the types further and not just the ones in const ignoreTypesInAllSchema = [ queryType?.name, mutationType?.name, subscriptionType?.name, ];

I think we have a lot of the functionality for this already in place! Maybe a categorizeAllTypes / assignAllTypesToRoot type of prop could do the trick.

Screenshot 2023-07-01 at 1 14 19 AM

Example solution
Screenshot 2023-07-01 at 1 23 41 AM

@acao
Copy link
Member

acao commented Jul 1, 2023

interesting idea! I'm going to ponder this a bit. you would expect this to be a boolean prop, yes?

@markbenliyan
Copy link
Author

interesting idea! I'm going to ponder this a bit. you would expect this to be a boolean prop, yes?

Yup! Or if we wanted it to be more specific maybe users can pass in the types they’d like to essentially turn into root types.

I could look into making a PR for this personally as well. My project needs this functionality so hoping we can get it in🙏

@markbenliyan
Copy link
Author

oh, and as a small note -- I'm imagining this would get passed in through DocExplorer so we can render the DocExplorer with this type of Schema Documentation! Clarifying in case I wasn't clear earlier

@acao
Copy link
Member

acao commented Jul 16, 2023

@markbenliyan indeed! we will soon move doc explorer to it's own plugin as originally proposed in 2019, but you could start with a PR to graphiql and @graphiql/react

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