Improved DI and GraphQL builder support #761
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I discovered the library today, but it took a while to figure out how to set it up to work with the
IGraphQLBuilderthat GraphQL.Net now provides for DI setup. Once I got it working, I realized that the configuration could be wrapped in a single method working with the builder. Also, when working with DI we don't actually need a validator cache (the user registers their validators with DI, we query DI to find out what validators are available), allowing setup to be simplified even more.Changes in this PR:
IValidatorCache.ValidatorServiceProviderCachewhich doesn't actually hold a cache, it just does lookups in the service provider to see what validators are available. IMO this should deprecateValidatorServiceCache, but I wasn't able to mark it as obsolete due to obsolete warnings being treated as errors.