damian-lw
damian-lw

Reputation: 51

graphql where filter - "Unknown argument \"where\"

I tried to use where: filter on graphql query but unfortunately I got some error. What am I doing wrong?

shoeposts {
  data {
    attributes(where: {slug: "NikeDunkLow"}) 
    {
      title
      slug
    }
  }
}}
  "error": {
    "errors": [
      {
        "message": "Unknown argument \"where\" on field \"ShoepostEntity.attributes\".",
        "locations": [
          {
            "line": 4,
            "column": 18
          }
        ],
        "extensions": {
          "code": "GRAPHQL_VALIDATION_FAILED",
          "exception": {
            "stacktrace": [
              "GraphQLError: Unknown argument \"where\" on field ```

Thanks in advance

Upvotes: 3

Views: 2098

Answers (1)

Leffa
Leffa

Reputation: 494

Seems like you are using Strapi

you should use filters instead where. And you should inform the conditional

and, or, not, eq, qei, ne, startsWith, endsWith, contains, notContains, containsi, notContainsi, gt, gte, lt, lte, null, notNull,in, notIn, between

shoeposts {
  data {
    attributes(filters: {slug: { eq: "NikeDunkLow" }}) 
    {
      title
      slug
    }
  }
}}

Upvotes: 1

Related Questions