amplify-android
amplify-android copied to clipboard
Compound Filters in ModelQuery Predicate OR/AND/NOT in android
Before opening, please confirm:
- [X] I have searched for duplicate or closed issues and discussions.
Language and Async Model
Java
Amplify Categories
GraphQL API
Gradle script dependencies
implementation 'com.amplifyframework:core:1.35.4'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
implementation "androidx.multidex:multidex:2.0.1"
implementation 'com.amplifyframework:aws-auth-cognito:1.35.4'
implementation 'com.amplifyframework:aws-api:1.35.4'
implementation 'com.amplifyframework:aws-datastore:1.35.4'
Environment information
android studio
Link
Describe the bug
query(ModelQuery.list(Todo.class,Todo.TITLE.eq("5") || Todo.DESCRIPTION.between("s","a"), ModelPagination.limit(10)));
In the above code I'm getting an error Operator '||' cannot be applied to 'com.amplifyframework.core.model.query.predicate.QueryPredicateOperation<java.lang.Object>', 'com.amplifyframework.core.model.query.predicate.QueryPredicateOperation<java.lang.String>
.
My question is how to add or/and/not operator in android using java. I saw documentation this is only described for Javascript as:
let filter = {
or: [{ priority: {eq:1} },
{ priority: {eq:2} }]
};
await API.graphql({ query: listProducts, variables: { filter: filter}}));
Can we do the same in android java??