Skip to content

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

@jje-k

Description

@jje-k

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


Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageissues to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions