调用查询后控制台日志中出现错误,并且无法在组件中打印数据

问题描述

我遵循一些有关VueJS,Graphql和Apollo的教程,但我陷入了困境。 我在控制台日志中收到此错误,发送查询“ todos” ServerParseError时出错:JSON位置0中的意外令牌

这是我的代码

export const GET_MY_TODOS = gql`
  query getMyTodos {
    todos(where: { is_public: { _eq: false} },order_by: { created_at: desc }) {
      id
      title
      created_at
      is_completed
  }
 }`;

  data() {
    return {
      type: "private",filterType: "all",todos: [],}
  },apollo: {
     todos: {
       query: GET_MY_TODOS,},

但是我必须注意,在GraphiQL中,此查询工作得很好:

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...