Skip to content

Commit

Permalink
fix(hasura): crud filter types
Browse files Browse the repository at this point in the history
  • Loading branch information
alicanerdurmaz committed May 15, 2024
1 parent 18b13d3 commit 85f216f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .changeset/modern-rings-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@refinedev/hasura": patch
---

fix: [`hasuraFilters`](https://github.com/refinedev/refine/blob/master/packages/hasura/src/utils/generateFilters.ts) object type.

All fields in the [`CrudOperators`](https://github.com/refinedev/refine/blob/master/packages/core/src/contexts/data/types.ts#L218) interface must be used in the [`hasuraFilters`](https://github.com/refinedev/refine/blob/master/packages/hasura/src/utils/generateFilters.ts) object type, but some fields may not be supported by Hasura. To resolve this, the object type has been changed to partial.
5 changes: 2 additions & 3 deletions packages/hasura/src/utils/generateFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ export type HasuraCrudFilter = HasuraLogicalFilter | HasuraConditionalFilter;

export type HasuraCrudFilters = HasuraCrudFilter[];

const hasuraFilters: Record<
HasuraCrudOperators,
HasuraFilterCondition | undefined
const hasuraFilters: Partial<
Record<HasuraCrudOperators, HasuraFilterCondition | undefined>
> = {
eq: "_eq",
ne: "_neq",
Expand Down

0 comments on commit 85f216f

Please sign in to comment.