Skip to content

Filter by query variable #12

Description

@1moeses

Is it actually possible to filter by query variables?

query post($id: String) {
  allPosts(filter: {_id: $id}) {
    title
    __typename
  }
}
{
  "id": "5c69be76387945700280002a4"
}

I always get an empty array:

{
  "data": {
    "allPosts": []
  }
}

even though apollo-client-dev-tools is showing me the variable

query post{
  allPosts(filter: {_id: "5c69be76387945700280002a4"}) {
    title
    __typename
  }
}

works fine.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions