I'm trying to filter results based on the id of a child on graphql and receiving the following error:
"Expected JSON object for '$[filter]' but got a 'STRING' instead."
Most of the code was generated by aws amplify.
Schema
type Company {
id: ID!
name: String!
disabled: Int
}
type Customer {
id: ID!
name: String!
company: Company!
disabled: Int
}
input ModelCustomerFilterInput {
id: ModelIDFilterInput
name: ModelStringFilterInput
disabled: ModelIntFilterInput
company: ModelCompanyFilterInput #added by me
and: [ModelCustomerFilterInput]
or: [ModelCustomerFilterInput]
not: ModelCustomerFilterInput
}
input ModelCompanyFilterInput {
id: ModelIDFilterInput
name: ModelStringFilterInput
disabled: ModelIntFilterInput
and: [ModelCompanyFilterInput]
or: [ModelCompanyFilterInput]
not: ModelCompanyFilterInput
}
Query
query ListCustomers($filter: ModelCustomerFilterInput, $limit: Int, $nextToken: String) {
listCustomers(filter: $filter, limit: $limit, nextToken: $nextToken) {
__typename
items {
__typename
id
name
company {
__typename
id
name
disabled
}
disabled
}
nextToken
}
}
{"filter": {"company": {"id": {"eq": "example"}}}}
content-typeset toapplication/json?