Switch query execution to a mutation and add cancellation#855
Closed
kmcginnes wants to merge 1 commit intoaws:main-query-editorfrom
Closed
Switch query execution to a mutation and add cancellation#855kmcginnes wants to merge 1 commit intoaws:main-query-editorfrom
kmcginnes wants to merge 1 commit intoaws:main-query-editorfrom
Conversation
Collaborator
Author
|
Holding off on this PR until after the release |
5 tasks
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #855 +/- ##
==========================================
+ Coverage 30.72% 32.52% +1.80%
==========================================
Files 525 527 +2
Lines 23627 21365 -2262
Branches 1408 1451 +43
==========================================
- Hits 7259 6949 -310
+ Misses 16241 14294 -1947
+ Partials 127 122 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fed8122 to
be1ba3a
Compare
5 tasks
Collaborator
Author
|
Closing this in favor of #949 |
5 tasks
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.
Description
Switches away from
useQuery()as the mechanism of executing the user provided query. Instead it usesuseMutation().This is to prevent unintended executions of the query.
useQueryis designed to be executed when React renders the view. But that is not desired in this case. Especially if the user happens to be running an actual Gremlin mutation query. That could lead to multiple nodes created/modified/deleted.The mutation version only executes when called. This means if the view is unmounted and remounted, then the query results are lost. The user must re-run the query explicitly. While I'm sure I could find a way to somehow persist these results in a way that makes sense, there's not a simple solution. So I'm kicking the can down the road to a future where that functionality is asked for explicitly.
As a result of this change, I can no longer reuse
SearchResultListcomponent. So I duplicated and modified that view for the raw query mutation. This removes the cancel button (which didn't work) and customizes the loading and error messages to be more appropriate for the context.Also, added cancellation to the mutation.
Validation
Related Issues
Check List
license.
pnpm checksto ensure code compiles and meets standards.pnpm testto check if all tests are passing.Changelog.md.