Skip to content

Commit 4410012

Browse files
authored
add value filtering for useQuery(Type, { mode: "public", … }) (#439)
1 parent eaa633a commit 4410012

File tree

9 files changed

+527
-20
lines changed

9 files changed

+527
-20
lines changed

.changeset/two-moose-speak.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@graphprotocol/hypergraph-react": patch
3+
"@graphprotocol/hypergraph": patch
4+
---
5+
6+
add value filtering for useQuery(Type, { mode: "public", … })
7+

apps/events/src/components/playground.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ export const Playground = ({ spaceId }: { spaceId: string }) => {
1717
jobOffers: {},
1818
},
1919
},
20+
// filter: {
21+
// name: {
22+
// startsWith: 'test',
23+
// },
24+
// },
2025
first: 100,
2126
space: spaceId,
2227
});

docs/docs/filtering-query-results.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
The filter API allows you to filter the results of a query by property values and in the future also by relations.
44

5-
Note: Filtering is not yet supported for public data.
6-
75
## Filtering by property values
86

97
```tsx
@@ -89,8 +87,8 @@ The filter API supports different filters for different property types and offer
8987
const { data } = useQuery(Person, {
9088
filter: {
9189
or: [
92-
not: { name: { is: "Jane Doe" } },
93-
not: { name: { is: "John Doe" } },
90+
{ not: { name: { is: 'Jane Doe' } } },
91+
{ not: { name: { is: 'John Doe' } } },
9492
],
9593
},
9694
});
@@ -99,11 +97,11 @@ const { data } = useQuery(Person, {
9997
const { data } = useQuery(Person, {
10098
filter: {
10199
age: {
102-
equals: 42
100+
is: 42
103101
},
104102
or: [
105-
not: { name: { is: "Jane Doe" } },
106-
not: { name: { is: "John Doe" } },
103+
{ not: { name: { is: 'Jane Doe' } } },
104+
{ not: { name: { is: 'John Doe' } } },
107105
],
108106
not: {
109107
or: [

0 commit comments

Comments
 (0)