-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
chore(@aws-amplify/datastore): docstrings, small refactors, cleanup unused predicate function #11040
Conversation
…nup as anys and bangs
* TODO: the sortof-immutable algorithm was originally done to support legacy style | ||
* predicate branching (`p => p.x.eq(value).y.eq(value)`). i'm not sure this is | ||
* necessary or beneficial at this point, since we decided that each field condition | ||
* must flly terminate a branch. is the strong mutation barrier between chain links | ||
* still necessary or helpful? |
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.
Realistically, we'll never revisit this immutability. It has value if we ever need to extend predicates. And if we refactor here (which is possible), it'll be done holistically; not for the purpose of addressing this specific algorithmic choice.
* | ||
* @param modelDefinition The model that the AST/predicate must be compatible with. | ||
* @param ast The graphQL style AST that should specify conditions for `modelDefinition`. | ||
*/ | ||
static createFromAST( | ||
modelDefinition: SchemaModel, | ||
ast: any |
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.
A separate PR will attempt to address the any
here.
* | ||
* @param gql GraphQL style filter node. | ||
*/ | ||
static transformGraphQLFilterNodeToPredicateAST(gql: any) { |
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.
A separate PR will attempt to address the any
here.
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #11040 +/- ##
==========================================
- Coverage 85.65% 82.24% -3.42%
==========================================
Files 196 193 -3
Lines 18261 19367 +1106
Branches 3892 4185 +293
==========================================
+ Hits 15642 15928 +286
- Misses 2543 3151 +608
- Partials 76 288 +212
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
This is fantastic! Thanks for doing this!
Description of changes
A batch of refactors, comments, etc., intended to improve readability.
Relationship
class'sallFrom
method instead of duplicating that logic inline.Issue #, if available
Description of how you validated changes
No functional changes intended. Tests are expected to pass.
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.