My schema and queries are working fine on amplify console but throwing a type mismatch error on the client side. This happens only when there are more than one records in the object returned
Data successfully returned when there's only one record
Error when object contains more than one record
Schema:
type Member {
Id: ID
PartyId: String
Status: MemberStatus
PersonName: MemberName
Email: String
UniformId: String
Name: String
}
type MemberName {
FirstName: String
LastName: String
FullName: String
InformalName: String
}
type MemberStatus {
PartyStatusId: String
Name: String
Description: String
ActiveStatus: Int
}
type Query {
listMembers(id: ID, firstName: String, lastName: String): [Member]
}
My query on the frontend
// Single Record
const [isLoading, state, error] = useGraphql(queries.listMembers, {
firstName: "BlaBle",
lastName: "Blu",
})
// Multiple Records
const [isLoading, state, error] = useGraphql(queries.listMembers, {
firstName: "blee",
})
Resolver
Am I missing something or doing something wrong here? Let me know if more info is required.
Thanks!