Azure / Azure/data-api-builder

[Bug]: GraphQL fails translating filter with "in" predicate (Cosmos DB backend)

Open
#3,061 0 comments 4 reactions 0 assignees View on GitHub
bug cosmos cri known-issue triage
Dominant language
C#
Stars
1.5k
Forks
370
Avg merge
3d 17h
Merged PRs (30d)
8

Description

### What happened?

When querying a Data API Builder (DAB) GraphQL endpoint backed by Azure Cosmos DB (NoSQL), queries that use the in filtering operator fail at runtime, even though the operator is exposed in the GraphQL schema via introspection.

The schema correctly advertises support for the in operator on both IdFilterInput and StringFilterInput. However, any query that attempts to use in results in a runtime error:

Cannot build unknown predicate operation IN.

**Observed behavior**
- This indicates a mismatch between the generated GraphQL schema and the underlying filter translation logic for Cosmos DB.

- in is present in IdFilterInput and StringFilterInput via schema introspection.

- Queries using in fail during execution with a predicate translation error.

- The error occurs regardless of whether in is used on id or string fields.

- Alternative operators such as eq work as expected.

- Large or + eq filters work but scale poorly.

- Multi-lookup via item_by_pk aliases works and avoids the issue.

**Expected behavior**

If the GraphQL schema exposes the in operator for a filter input, queries using it should either:
- Execute successfully against Cosmos DB, or

- Be rejected at schema generation or validation time if unsupported.

**Impact**

This makes it difficult to efficiently query entities by a list of IDs using GraphQL filtering. Consumers are forced to use less performant workarounds (large or expressions or multiple point reads via aliases), even though list membership semantics are exposed in the schema.

**Key question**

Is the in filter operator intended to be supported for Cosmos DB backends in Data API Builder?
If not, should it be excluded from the generated GraphQL schema to avoid confusion?

### Version

v1.6.84

### What database are you using?

CosmosDB NoSQL

### What hosting model are you using?

Container Apps

### Which API approach are you accessing DAB through?

GraphQL

### Relevant log output

```Text

```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.