Skip to content

Commit

Permalink
test: fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Jan 15, 2024
1 parent f8568e8 commit 062f72a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ export default defineComponent({
const { result, loading } = useQuery<{ channels: Channel[] }>(gql`
query channels {
channels {
id
label
...channel
}
}
fragment channel on Channel {
id
label
}
`)
const channels = computed(() => result.value?.channels ?? [])
Expand Down
14 changes: 9 additions & 5 deletions packages/test-e2e-composable-vue3/src/components/ChannelView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ export default defineComponent({
const { result, loading, refetch } = useQuery(gql`
query channel ($id: ID!) {
channel (id: $id) {
...channelView
}
}
fragment channelView on Channel {
id
label
messages {
id
label
messages {
id
text
}
text
}
}
`, () => ({
Expand Down

0 comments on commit 062f72a

Please sign in to comment.