graphql-ruby icon indicating copy to clipboard operation
graphql-ruby copied to clipboard

Improve visiblity / type filtering

Open rmosolgo opened this issue 1 year ago • 3 comments

In #4998, I started on a new schema visibility implementation. I have a few goals here:

  • Make it possible to load GraphQL types lazily -- only loading types needed by a given query.
  • Make it possible to use cached schema subsets (don't have to recalculate the visible schema on every query -- when possible)
  • Improve logging and debugging of visibility (especially when types are hidden)
  • Make a very smooth migration process:
    • Use the Query#types interface to support logging when the two systems would diverge
    • Clearly document the expectations of the new system (Warden was basically never documented, and arguably tried to do too much, but couldn't do everything)

I'm opening this issue for my own purposes but also in case anyone wants to share any thoughts or questions on the work.

TODO:

  • [x] Build a Subset cache-by-name system
  • [x] Make field return types lazy-loadable #5054
  • [x] Make root types lazy-loadable from the schema #5055
  • [ ] Update the install generator to add Rubocop rules to rails (when the file is present)
  • [x] Make it easier to start using Subset than self.use_schema_subset = true
  • [x] Make a way to preload everything in Production
  • [ ] Warn when Warden is used without being explicitly included

rmosolgo avatar Jul 12 '24 15:07 rmosolgo