Merged
Conversation
Contributor
There was a problem hiding this comment.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.