Filter where:{field_null:true} not working in graphql

System Information
  • Strapi Version: 3.4.3
  • Operating System:
  • Database:
  • Node Version:
  • NPM Version:
  • Yarn Version:

Hello, I want to query all the parent productCategories with the following graphql query (both parentCategory and childCategories are self reference relations: parentCategory has many childCategories):

query{
  productCategories(where: {parentCategory_null: true}){
    name
    slug
    parentCategory{
      name
      slug
    }
    childCategories{
      name
      slug
    }
  }
}

but it returnes

{
  "data": {
    "productCategories": []
  }
}

while it is expected to return:

{
  "data": {
    "productCategories": [
      {
        "name": "Jackets",
        "slug": "jackets",
        "parentCategory": null,
        "childCategories": [
          {
            "name": "Leather Jackets",
            "slug": "leather-jacekts"
          },
          {
            "name": "Coach Jackets",
            "slug": "coach-jackets"
          }
        ]
      },
      {
        "name": "Pants",
        "slug": "pants",
        "parentCategory": null,
        "childCategories": []
      }
    ]
  }
}

Related post: https://forum.strapi.io/t/any-workround-for-hierarchical-collection/691

Thanks

Issue 5414

My bad, didn’t find the issue before.