Api-platform: GraphQL - filter item in array

Created on 8 Aug 2018  路  3Comments  路  Source: api-platform/api-platform

Hi, thanks for the amazing work you're doing with this project.

I'm looking for a way to filter my entities by an array of values.

As said in documentation : Another difference with the REST API filters is that the keyword _list must be used instead of the traditional [] to filter over multiple values.

So my GraphQL request should look like :

{
  offers(product_color_list: ["red", "green"]) {
    edges {
      node {
        id
        product {
          name
          color
        }
      }
    }
  }
}

documentation reference : https://api-platform.com/docs/core/graphql/#filtering-on-nested-properties

However it's not working for me... GraphiQL shows an error Unknown argument

How can I make this work ?

GraphQL question

All 3 comments

I think it's because it has been fixed recently. No release with the fix has been made yet.

@alanpoulain I just updated my composer.json to use the dev-master version of the core bundle. It's working perfectly !

Thank you for the quick response.

I think it should be written somewhere while the fix isn't part of a release.

I think the documentation should be "released" like the code ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ajaunasse picture ajaunasse  路  3Comments

sverraest picture sverraest  路  3Comments

florent-andre picture florent-andre  路  3Comments

raresserban picture raresserban  路  3Comments

ad3n picture ad3n  路  4Comments