3

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
damian-lw
  • 51
  • 7

1 Answers1

1

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
    }
  }
}}
Leffa
  • 369
  • 4
  • 7