From 062f72a9b737fd4d931441656ae3e64b310742a2 Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Mon, 15 Jan 2024 10:55:52 +0100 Subject: [PATCH] test: fragment --- .../src/components/ChannelList.vue | 8 ++++++-- .../src/components/ChannelView.vue | 14 +++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/test-e2e-composable-vue3/src/components/ChannelList.vue b/packages/test-e2e-composable-vue3/src/components/ChannelList.vue index 09561058..4e318104 100644 --- a/packages/test-e2e-composable-vue3/src/components/ChannelList.vue +++ b/packages/test-e2e-composable-vue3/src/components/ChannelList.vue @@ -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 ?? []) diff --git a/packages/test-e2e-composable-vue3/src/components/ChannelView.vue b/packages/test-e2e-composable-vue3/src/components/ChannelView.vue index b79e2a6e..32747a92 100644 --- a/packages/test-e2e-composable-vue3/src/components/ChannelView.vue +++ b/packages/test-e2e-composable-vue3/src/components/ChannelView.vue @@ -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 } } `, () => ({