-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing unintended update to GraphQL operation when updating REST methods #1555
Merged
severussundar
merged 215 commits into
main
from
dev/shyamsundarj/bugfix-update-rest-methods
Jul 5, 2023
Merged
Fixing unintended update to GraphQL operation when updating REST methods #1555
severussundar
merged 215 commits into
main
from
dev/shyamsundarj/bugfix-update-rest-methods
Jul 5, 2023
Conversation
This file contains 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
Finding missing types Refactoring some type names Simplifying the GraphQL naming by doing that when building the config, rather than on demand
Added implementation of JsonConverter.Write methods to generate an initial pass on the config file using CLI
Removed some tests that weren't testing the CLI but dependencies (such as CommandLineParser or ILogger)
…them simpler and clearer with the new object structure
Moved logic for Entities defaults to RuntimeEntities rather than deserialiser, as that is a more logical place. We always pass that type around, so we can assume the ctor ran, but we aren't always assuming the deserialiser ran (such as what happens with tests)
This would cause the runtime to then never find a config file as it would bypass name resolution
…ure/data-api-builder into aaronpowell/new-config-engine
aaronpowell
reviewed
Jul 3, 2023
aaronpowell
approved these changes
Jul 3, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Waiting for the tests to pass.
I like that we have another Verify test in there!
abhishekkumams
approved these changes
Jul 5, 2023
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.
Why make this change?
Command:
dab add getbooks --source "get_books" --source.type "stored-procedure" --permissions "anonymous:execute" --graphql.operation "query"
Config Json (just the entities section):
Command:
dab update getbooks --rest.methods "GET"
Config Json:
When updating the rest.methods, the graphql operation has lost its original value of
query
. It now has the default value ofmutation
.What is this change?
ConfigGenerator.ConstructUpdatedGraphQLDetails()
: When GraphQL operation is not updated, logic for preserving the existing configured graphQL operation is addedEndToEndTests.TestUpdatingStoredProcedureWithRestMethods()
: Adds a test case with the mentioned repro stepsHow was this tested?
Sample Request(s)
dab add getbooks --source "getbooks" --source.type "stored-procedure" --permissions "anonymous:execute" --graphql.operation "query"
dab update getbooks --rest.methods "get,patch"
The
rest.methods
field is updated with the right values and the existing value ofgraphql.operation
is preserved