graphql-ruby
graphql-ruby copied to clipboard
Improve visiblity / type filtering
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#typesinterface 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)
- Use the
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
Subsetcache-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
Subsetthanself.use_schema_subset = true - [x] Make a way to preload everything in Production
- [ ] Warn when Warden is used without being explicitly included