-
Notifications
You must be signed in to change notification settings - Fork 10
Add entity id for relation and backlink #590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds support for filtering relation/backlink fields by the connected entity’s ID, extending the existing filter→GraphQL translation to map entityId onto toEntityId (relations) or fromEntityId (backlinks). Also updates docs, tests, and the events app with an example route demonstrating the new filtering capability.
Changes:
- Extend
translateFilterToGraphqlto supportentityIdon relation/backlink filters and emitrelationsvsbacklinksappropriately. - Add/adjust test coverage for relation/backlink
existsandentityIdfilter translation cases. - Document relation/backlink filtering by existence and by connected entity ID; add an events app demo route and a changeset.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/hypergraph/src/utils/translate-filter-to-graphql.ts | Adds entityId filter translation and differentiates forward relations vs backlinks in GraphQL filter output. |
| packages/hypergraph/src/entity/types.ts | Extends relation filter typing to accept entityId (string shorthand or object form). |
| packages/hypergraph/test/utils/translate-filter-to-graphql.test.ts | Adds tests for entityId filters on relations and backlinks; updates relation exists typing expectations. |
| docs/docs/filtering-query-results.md | Documents relation/backlink filtering by existence and by connected entity ID. |
| apps/events/src/schema.ts | Adds schemas used to demonstrate backlink filtering (Bounty, PersonBacklink). |
| apps/events/src/routes/bounties.lazy.tsx | New demo route showing entityId filtering on a backlink field. |
| apps/events/src/routes/__root.tsx | Adds navigation link to the new bounties route. |
| apps/events/src/routeTree.gen.ts | Updates generated route tree to include /bounties. |
| .claude/settings.local.json | Expands allowed tooling/devtools permissions. |
| .changeset/add-entity-id-relation-filter.md | Declares a minor version bump for the new filter capability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.