Require GraphQLContext to always return an instance of DataLoaderRegistry and never null
oliemansm opened this issue · 0 comments
oliemansm commented
GraphQLContext.getDataLoaderRegistry() returned an Optional instead of just the DataLoaderRegistry. While we should be treating it the same way as if it's a collection in which case you also wouldn't return null or wrapped in an Optional. Instead you would just return an empty collection. Analogous we require an empty DataLoaderRegistry to be returned as a minimum. This benefits users of the registry.