-
Notifications
You must be signed in to change notification settings - Fork 227
fix(DataStore): support for QueryPredicateConstant.all for graphql queries #1013
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,6 +77,8 @@ extension QueryPredicate { | |
| return operation.graphQLFilter(for: modelSchema) | ||
| } else if let group = self as? QueryPredicateGroup { | ||
| return group.graphQLFilter(for: modelSchema) | ||
| } else if let constant = self as? QueryPredicateConstant { | ||
| return constant.graphQLFilter(for: modelSchema) | ||
| } | ||
|
|
||
| preconditionFailure( | ||
|
|
@@ -98,6 +100,15 @@ extension QueryPredicate { | |
| } | ||
| } | ||
|
|
||
| extension QueryPredicateConstant: GraphQLFilterConvertible { | ||
| func graphQLFilter(for modelSchema: ModelSchema?) -> GraphQLFilter { | ||
| if self == .all { | ||
| return [:] | ||
|
Comment on lines
+104
to
+106
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just thinking whether the return value should just be
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm I think it would be useful to change if we had a use case of detecting nil vs an empty GraphQLFilter. In this case, of |
||
| } | ||
| preconditionFailure("Could not find QueryPredicateConstant \(self)") | ||
| } | ||
| } | ||
|
|
||
| extension QueryPredicateOperation: GraphQLFilterConvertible { | ||
|
|
||
| func graphQLFilter(for modelSchema: ModelSchema?) -> GraphQLFilter { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.