firebase / firebase/firebase-tools

[Data Connect] Support passing Filter and Order types as top-level variables

Open
#9,752 2 comments 7 reactions 2 assignees Claimed by @HYACCCINT View on GitHub
api: dataconnect fr: dataconnect nested input type: feature request
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### Feature Description
Currently, the Data Connect compiler blocks the use of auto-generated Filter and Order types (e.g., `Product_Filter`, `Product_Order`) as top-level GraphQL variables.

When attempting to use them in a generic list query, the compiler throws:
`On $where: does not support Product_Filter as an input variable`

### Use Case
I am building a dashboard with **React-Admin**, which relies on dynamic filtering and sorting. To keep my `dataProvider` clean and "DRY", I need to be able to pass a structured filter object from the client directly to the query.

**Example Query:**
```graphql
query ListProducts(
$where: Product_Filter,
$orderBy: [Product_Order!],
$limit: Int,
$offset: Int
) {
data: products(where: $where, orderBy: $orderBy, limit: $limit, offset: $offset) {
id
name
}
total: products_aggregate(where: $where) {
count
}
}

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.