作者:小小追求者 | 来源:互联网 | 2023-07-06 09:23
I am using vue apollo inside Laravel. I followed the official documentation. Fetching data according to this:
https://vue-apollo.netlify.com/guide/apollo/#apollo is perfectly fine.
I wanted to use the apollo components to fetch the data.
So my Home.vue component looks like this:
My
file looks like this:
1 2 3 4 5 6 7
| gql
query {
categories {
id
name
}
} |
But while running yarn dev / watch i get the following error:
1 2 3 4 5 6 7
| RROR in ./resources/js/graphql/queries/categories.graphql 1:6
Module parse failed: Unexpected token (1:6)
You may need an appropriate loader to handle this file type.
> query {
| categories {
| id
@ ./resources/js/components/Home.vue?vue&type=template&id=f2b6376c& (./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/Home.vue?vue&type=template&id=f2b6376c&) 9:24-72 |
该提问来源于开源项目:vuejs/vue-apollo
I did fix it by
Which displays loading message when the data is loading.
many thanks. Closing the issue.