# Filters

The filter argument on issues, users and workflow states: comparators, and and or, and one hop into related records.

A `filter` narrows `issues`, `users` and `workflowStates` to the records that match, as it does on Linear. Filter the board for issues in a completed state, then for issues that are completed or whose title starts with `Flaky`:

```bash
curl -s "$RYSTIC_URL/graphql" -H 'Authorization: lin_placeholder' -H 'Content-Type: application/json' \
  -d '{"query":"{ issues(filter: {state: {name: {eq: \"Done\"}}}) { nodes { identifier } } }"}' | jq -c '[.data.issues.nodes[].identifier]'
# -> ["ENG-106"]
curl -s "$RYSTIC_URL/graphql" -H 'Authorization: lin_placeholder' -H 'Content-Type: application/json' \
  -d '{"query":"{ issues(filter: {or: [{state: {type: {eq: \"completed\"}}}, {title: {startsWith: \"Flaky\"}}]}) { nodes { identifier } } }"}' | jq -c '[.data.issues.nodes[].identifier]'
# -> ["ENG-106","ENG-101"]
curl -s "$RYSTIC_URL/graphql" -H 'Authorization: lin_placeholder' -H 'Content-Type: application/json' \
  -d '{"query":"{ users(filter: {name: {contains: \"Yuki\"}}) { nodes { name } } }"}' | jq -c '[.data.users.nodes[].name]'
# -> ["Yuki Sato"]
```

### What a filter reads

The simulator applies `eq`, `neq`, `in`, `nin`, `lt`, `lte`, `gt`, `gte`, `contains`, `startsWith`, `endsWith`, their `IgnoreCase` forms and `null`, joined by `and` and `or`, on each list's scalar fields and one hop into `team`, `state`, `assignee`, `creator`, `project`, `cycle`, `parent` and `labels`.

### What a filter refuses

A filter outside that subset answers 400 `GRAPHQL_VALIDATION_FAILED` where Linear answers the query: a field the simulator does not read (`estimate`, `dueDate`, `isMe`, `state.team`), a relative date such as `-P2W`, `notStartsWith`, `notEndsWith`, the `AndAccent` forms and a nullable relation that mixes `null` with a sub-field.

```bash
curl -s "$RYSTIC_URL/graphql" -H 'Authorization: lin_placeholder' -H 'Content-Type: application/json' \
  -d '{"query":"{ issues(filter: {estimate: {eq: 3}}) { nodes { identifier } } }"}' | jq -c '.errors[0] | {message, code: .extensions.code}'
# -> {"message":"Expected value of type \"IssueFilter\", found not a filterable field.","code":"GRAPHQL_VALIDATION_FAILED"}
```

---

Source: https://www.rystic.ai/docs/simulators/linear/features/filters · Markdown: https://www.rystic.ai/docs/simulators/linear/features/filters.md
