anvilco/spectaql

Breadcrumb/Required-by links for types

Opened this issue · 2 comments

Perhaps a feature I just can't find, but one of the things graphdoc does well is highlighting where types are used.

image.

When the user clicks a "require by" link, they'll be brought to the type that defines it and have its own set of required by types ultimately forming a breadcrumb-like chain.

When navigating with SpectaQL types, especially for GraphQL schemas with lots of nested types, I have to actually CTRL+F to find where those types are defined in parent types.

While SpectaQL adds a lot, a feature like this would be a must-have for adoption over graphdoc

@newhouse Any idea for a good starting point if a Dev were to come in and create a PR for this?

There are a few steps to making this a reality, as I see things:

  1. You need a way to build up and provide all the references for a Type (so that you can display them). If/when I did this, I would update microfiber to provide this functionality.
  2. Get the data needed about the references into the data provided to the templating system. I would probably add it here or perhaps in here.
  3. Create a custom theme where you enhance the part of the templates that render types to include the references section.

I think that's about it. Not too difficult, and probably the hardest part would be gathering the references...not that it would be particularly challenging.

I would probably agree to do the work on Microfiber and getting the references into the data for the templates...but not sure if I would actually put the references into the templates right now...at least not by default. Nobody else has asked for this so far.