热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

FacingissueswithLaravel:Youmayneedanappropriateloadertohandlethisfiletype.

IamusingvueapolloinsideLaravel.Ifollowedtheofficialdocumentation.Fetchingda

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:

1
2
3
4
5
6
7
8
9
10
11
vue

 


   

     

   


 

My

1
categories.gql

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

1
2
3

Which displays loading message when the data is loading.

many thanks. Closing the issue.


推荐阅读
author-avatar
小小追求者
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有