Closed ShreyasBhandari closed 1 year ago
I've reproduced this issue with the following graphQL Schema:
# This "input" configures a global authorization rule to enable public access to
# all models in this schema. Learn more about authorization rules here: https://docs.amplify.aws/cli/graphql/authorization-rules
input AMPLIFY { globalAuthRule: AuthRule = { allow: public } } # FOR TESTING ONLY!
type Todo @model {
id: ID!
listOfIds1: [String]
listOfIds2: [String]!
listOfIds3: [String!]
listOfIds4: [String!]!
}
import { DataStore } from "aws-amplify";
import { Todo } from "./models";
const loadRecords = async () => {
await DataStore.query(Todo, item => item
.listOfIds1('contains', 'hi there')
.listOfIds2('contains', 'hi there')
.listOfIds3('contains', 'hi there')
.listOfIds4('contains', 'hi there')
);
};
The .listOfIds1
and .listOfIds2
do trigger a Argument of type 'string' is not assignable to parameter of type 'never'.ts(2345)
error.
This is no longer an issue with the new predicate syntax.
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Authentication, GraphQL API, DataStore, Storage
Amplify Categories
No response
Environment information
Describe the bug
Trying to query using datastore, using the contains predicate to find specific ids in an array, however typescript throws an error that expected operand is 'never'
Expected behavior
Expecting the query to accept a string as the operand, and fetch the results
Reproduction steps
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response