Improved DI and GraphQL builder support#761
Open
mbcrawfo wants to merge 5 commits intoSimonCropp:mainfrom
Open
Improved DI and GraphQL builder support#761mbcrawfo wants to merge 5 commits intoSimonCropp:mainfrom
mbcrawfo wants to merge 5 commits intoSimonCropp:mainfrom
Conversation
When using the DI service provider we don't need to maintain a cache of the available validator types. Querying the the service provider for a list of IValidator<T> will give us all matching validators.
Owner
|
can u add some tests for this |
Contributor
Author
|
@SimonCropp the test project fails to build because "markdownsnippets" returns errors about the readme containing invalid words "you" and "your". I've searched the documentation in this project and looked at the markdownsnippets project. It's rather confusing why a tool that (according to its readme) is for "extracting snippets from code files and merging them into markdown documents" cares about the wording of the document? That aside, I can't find anything to indicate what validation rules are being applied to the readme or what language it wants. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.