Open
Description
Describe the bug
I'm using Nuxt. I would want to be able to fetch queries defined by @vue/apollo-composable
by the client.
It works with the default component creation
export default {
name: 'Graphql',
apollo: {
testQuery: {
prefetch: false, // <--
query: TestQuery,
},
},
}
But not with the composition-api
export default defineComponent({
setup() {
const { result } = useQuery(TestQuery, {}, {
prefetch: false, // <--
});
return {
result,
};
},
});
The current behavior that I have, is a pending query. If I replace the prefetch: false
by fetchPolicy: 'no-cache'
I have an Ajax query AND a fetch by the server.
export default defineComponent({
setup() {
const { result } = useQuery(TestQuery, {}, {
fetchPolicy: 'no-cache',
// prefetch: false,
});
return {
result,
};
},
});
To Reproduce
- Checkout this project: https://github.com/shenron/vue-nuxt-tsx
- Try the page
grahpql.vue
andgraphql_composition.vue
Expected behavior
To be able to fetch only by the client
Versions
vue: 2.6.11
vue-apollo: 3.0.3
apollo-client: 2.6.10