-
Notifications
You must be signed in to change notification settings - Fork 8
graphql alias per relation + backlinks support #557
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e7c206d
split up relations per alias
nikgraf 4c9eb40
improve types
nikgraf 6e50e90
level 2 relations should only be included in the correct level 1 rela…
nikgraf 7070c2d
useEntityPublic to use Entity.findOnePublic
nikgraf 993c4ae
refactor searchManyPublic to construct nested relations aliases
nikgraf 9a18176
refactor findOnePublic to construct nested relations aliases
nikgraf 8336071
lint fixes
nikgraf 6def3aa
cleanup relationTypeIds usage
nikgraf d3fa182
use the hierarchical children data on each entry in infoLevel1 to dri…
nikgraf b18538d
cleanup getRelationTypeIds
nikgraf 62492c6
add support for Type.Backlink
nikgraf 530d8f9
lint fixes
nikgraf c5bb051
add changeset
nikgraf 07c2490
lint fix
nikgraf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@graphprotocol/hypergraph-react": patch | ||
| "@graphprotocol/hypergraph": patch | ||
| --- | ||
|
|
||
| add Type.Backlink | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,5 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { Entity } from '@graphprotocol/hypergraph'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { useEntities } from '@graphprotocol/hypergraph-react'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { createLazyFileRoute } from '@tanstack/react-router'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { useEffect } from 'react'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { Podcast } from '@/schema'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export const Route = createLazyFileRoute('/podcasts')({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -11,25 +9,43 @@ export const Route = createLazyFileRoute('/podcasts')({ | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| function RouteComponent() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const space = 'e252f9e1-d3ad-4460-8bf1-54f93b02f220'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| useEffect(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setTimeout(async () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const result = await Entity.findOnePublic(Podcast, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: 'f5d27d3e-3a51-452d-bac2-702574381633', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| space: space, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| include: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| listenOn: {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log('findOnePublic result:', result); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, 1000); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, []); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // useEffect(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // setTimeout(async () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // const result = await Entity.searchManyPublic(Podcast, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // query: 'Joe', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // space: space, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // // include: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // // listenOn: {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // // }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // console.log('searchManyPublic result:', result); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // }, 1000); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // }, []); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // const { data: podcast } = useEntity(Podcast, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // id: 'f5d27d3e-3a51-452d-bac2-702574381633', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // mode: 'public', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // space: space, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // include: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // listenOn: {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // hosts: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // avatar: {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // episodes: {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // console.log({ podcast }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+12
to
38
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // useEffect(() => { | |
| // setTimeout(async () => { | |
| // const result = await Entity.searchManyPublic(Podcast, { | |
| // query: 'Joe', | |
| // space: space, | |
| // // include: { | |
| // // listenOn: {}, | |
| // // }, | |
| // }); | |
| // console.log('searchManyPublic result:', result); | |
| // }, 1000); | |
| // }, []); | |
| // const { data: podcast } = useEntity(Podcast, { | |
| // id: 'f5d27d3e-3a51-452d-bac2-702574381633', | |
| // mode: 'public', | |
| // space: space, | |
| // include: { | |
| // listenOn: {}, | |
| // hosts: { | |
| // avatar: {}, | |
| // }, | |
| // episodes: {}, | |
| // }, | |
| // }); | |
| // console.log({ podcast }); |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
The changeset description is too brief and lacks proper capitalization. Consider providing a more descriptive message that explains what the change does, such as "Add Type.Backlink support for GraphQL alias per relation and backlinks".