java-dataloader
java-dataloader copied to clipboard
Add strict mode for DataLoaderRegistry
In a similar vein to https://github.com/graphql-java/graphql-java/pull/3565 which enabled "strict mode" for type wiring (preventing multiple DataFetchers being registered to the same field on a GraphQL type), we add "strict mode" to the DataLoaderRegistry so that we don't accidentally register multiple DataLoaders to the same key (which would result in the last registration winning). This can prevent confusing bugs from emerging.
This defaults to false to avoid breaking changes, and deliberately mimics the referenced PR to maintain consistency.