magidoc
magidoc copied to clipboard
Alternative documentation layout
Describe the problem
I really like the overall layout of the documentation provided, however, I don't find the long list of Queries & Mutations to be that useful, as this could simply be seen with introspection for example.
For our API users, it would make sense if we could group certain parts of the schema.
I know this would require manual configuration, but I think that would be acceptable for most people who would be looking for this sort of documentation.
For example, Shopify has their GraphQL documentation in groups, so everything to do with the cart is in the same place, see the image here:
Describe the proposed solution
I could see this working by having a small section in the website config like the example below
options: {
documentationGroups: [{
title: 'Cart',
match: ["^cart", "CartTransform"],
exclude: ["explicitlyExcludeThis"],
}],
}
In this example, you can see I wanted to create a section called Cart, which would include any Queries, Mutations, Subscriptions & Objects that started with cart, and I also explicitly included CartTransform. There is also a section to explicitly include something that may match your regex.
There could also be an option to include the list of Queries & Mutations like there is currently for any items that are not included in groups, or you could decide to not show them in the navigation.
Importance
Would make my life easier
It think this is also asked for here: https://github.com/magidoc-org/magidoc/issues/58
Hi, sorry for the late reply. That seems like an interesting feature, and I'd be happy to have that as part of magidoc. However, this is a feature that would take quite some time to implement, and my time is limited recently.
If you're interested in digging into the code and implement it, I'd be more than happy to review a PR and deploy it, but otherwise, it might take quite a bit of time for me to look at this.
Thank you!
I would be happy to dig into this. Do you have a contributing guide?
Yes, it's right there : https://github.com/magidoc-org/magidoc/blob/main/CONTRIBUTING.md
Let me know if you got any questions, I'll gladly answer 🙂