I am new to graphql, working on an existing schema. I've to add new filters into my existing API, but either my syntax is wrong or my query in postman is wrong.
Essentially, I want to be able to query on both population
and country
Here's how my schema looks:
scalar JSON
schema {
query: Query
}
....
input PercentageInput {
gte: Int
}
input Population {
percentage: PercentageInput
}
input Country {
percentage: PercentageInput
}
input And {
population: [Population]
country: [Country]
}
input AudienceFilterInput {
market: String
and: [Population]
}
input TalentMetadataFilterInput {
citizen_of: ListFilterInput
gender: [String]
original_country: [String]
audience: AudienceFilterInput
}
I would ideally want to query with both population and country with percentage greater than some value.
Whenever I query in Postman using this:
query MyQuery {
talentMetadata(
filter: { audience: { and: [ population {male_percentage : { gte: 80 }}, country { us_percentage : { gte: 30 }}]} },,
size: 100)..
}
I get the following error:
"message": "Field \"male_percentage\" is not defined by type \"Population\". Did you mean \"percentage\"?",
Also, if you share the postman query along with the schema, would be awesome.