python strawberry graphql error : "Field 'ReportInput.propertyType' of required type 'String!' was not provided."
Ran into this issue saying my field is not defined. Here is my input definitions
@strawberry.input
class ReportInput:
location: LocationInput
property_type: str
current_analysis: str
And here is my graphql mutations:
mutation {
saveReport(
report: {
location: {
suburb: "St Albans"
state: "Melbourne"
country: "Australia"
}
property_type: "House"
currentAnalysis: "Property analysis details..."
}
) {
status
id
location
propertyType
currentAnalysis
}
}
As you may have noticed 'property_type' is the same. However, in grapghql convert it to camel casing with it has delimiter "_". So changing the mutation as follows works.
👍
mutation {
saveReport(
report: {
location: {
suburb: "St Albans"
state: "Melbourne"
country: "Australia"
}
propertyType: "House"
currentAnalysis: "Property analysis details..."
}
) {
status
id
location
propertyType
currentAnalysis
}
}
Comments