Created
May 6, 2020 22:25
-
-
Save jensen/c832022e7a1cdd76d7310bdff01b500b to your computer and use it in GitHub Desktop.
Song Container Relay Example
This file contains 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
query SongsContainerQuery($count: Int!, $cursor: String) { | |
viewer { | |
...SongsContainer_viewer | |
} | |
} | |
fragment SongsContainer_viewer on Query { | |
id | |
songs(first: $count, after: $cursor) | |
@connection(key: "SongsContainer_songs", filters: []) { | |
edges { | |
cursor | |
node { | |
id | |
...SongItem_song | |
} | |
} | |
} | |
} | |
query SongItemQuery($id: ID!, $count: Int!, $cursor: String) { | |
song(id: $id) { | |
...SongItem_song @arguments(count: $count, cursor: $cursor) | |
} | |
} | |
fragment SongItem_song on Audio | |
@argumentDefinitions( | |
count: { type: "Int", defaultValue: 20 } | |
cursor: { type: "String", defaultValue: null } | |
) { | |
id | |
...CommentsContainer_song | |
# ...more pagination container other_song | |
} | |
query CommentsContainerQuery($id: ID!, $count: Int!, $cursor: String) { | |
song(id: $id) { | |
...CommentsContainer_song | |
} | |
} | |
fragment CommentsContainer_song on Audio { | |
id | |
comments(first: $count, after: $cursor) | |
@connection(key: "CommentsContainer_comments", filters: []) { | |
edges { | |
id | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment