In my React app, I want to pass an object as variable type into my mutation. Here's how my mutation looks like:
export const PAR_CREATE = gql`
input Resources {
resourceName: String
quantity: String
sequenceNo: String
}
mutation createPAR(
$resourceType: String
$title: String
$description: String
$dropOfName: String
$dropOfAddress: String
$endDate: String
$studentsImpacted: String
$schoolId: String
$resources: [Resources]
) {
createPAR(
resourceType: $resourceType
title: $title
description: $description
dropOfName: $dropOfName
dropOfAddress: $dropOfAddress
endDate: $endDate
studentsImpacted: $studentsImpacted
schoolId: $schoolId
resources: $resources
) {
id
}
}
`;
In my Node.js project I have the following schema:
type Mutation {
createPAR(
resourceType: String
title: String
description: String
dropOfName: String
dropOfAddress: String
endDate: String
studentsImpacted: String
schoolId: String
resources: [Resources]
): parResponse
}
input Resources {
resourceName: String
quantity: String
sequenceNo: String
}
i am getting this issue "Invariant Violation: Schema type definitions not allowed in queries. Found: "InputObjectTypeDefinition"
can any one help