预期结果:
全局捕获data.error,比如react-apollo告诉我如下:
Unhandled (in react-apollo) Error: GraphQL error: Not authorized for Query.myQuery
at new ApolloError (http://localhost:4000/static/js/bundle.js:3637:28)
at ObservableQuery../node_modules/apollo-client/core/ObservableQuery.js.ObservableQuery.currentR
我可以使混合方法工作,但我想使用完整的websocket传输,其中每个graphql操作都是在套接字上完成的。我确实很喜欢他们的。
import { SubscriptionClient } from 'subscriptions-transport-ws'
import ApolloClient from 'apollo-client'
import gql from 'graphql-tag'
const client = new SubscriptionClient('ws://localhost:5000/graphql'
当我试图查询数据时,我得到了这个长错误。这是有效的数据(针对GraphQLi进行测试)。任何指导都将不胜感激!
Error: Network error: Cannot read property 'slice' of undefined
at new ApolloError (eval at ./node_modules/apollo-client/errors/ApolloError.js (main.js:914), <anonymous>:34:28)
at ObservableQuery.currentResult (eval at ./n
我在后端使用阿波罗服务器速递,在前端使用下一个js。
我一直试图从上下文中使用(响应)在后端设置cookie,但不幸的是,它不起作用。我需要你的帮助。
这是我的后端代码。
import http from 'http';
import { ApolloServer } from 'apollo-server-express';
import express from 'express';
import cors from 'cors';
import { makeExecutableSchema } from '@grap
我正在尝试使用ReactiveAlolon2.1为组件提供一个模拟模式。但是,它返回此错误。
Error: Network error: No more mocked responses for the query: {
me {
id
email
username
first_name
last_name
bio
website
}
}
, variables: {}
at new ApolloError (ApolloError.js:43)
at ObservableQuery.currentResult (
我试图将指令添加到我们的GraphQL API中,然后按照这个示例,,但是,我一直得到服务器错误(没有服务器工作的指令!):
** Uncaught Error: Duplicate schema type name Integer **
at home/node_modules/apollo-server-core/node_modules/graphql-tools/dist/schemaVisitor.js:243:27
at home/node_modules/apollo-server-core/node_modules/graphql-tools/dist/sche
我正在用@apollo/react-hooks做一个简单的测试,我得到了这个错误:
ApolloError.ts:46 Uncaught (in promise) Error: Network error: Unexpected end of JSON input
at new ApolloError (ApolloError.ts:46)
at Object.error (QueryManager.ts:255)
at notifySubscription (Observable.js:140)
at onNotify (Observable.js:179)
尝试使用Apollo客户端提供的ApolloClient.Query调用查询我的graphql端点,并返回结果。遵循文档中的指导原则,我应该能够在自定义angular 4组件中快速、粗略地执行以下操作:
import { Component } from '@angular/core';
import { AuthService } from '../services/auth.service';
import { User } from '../models/user';
import { Apollo } from 'apollo-
我目前正在使用用于阿波罗客户端的vue-apollo包和带有django的VueJs栈,以及用于我的GraphQl应用程序接口的石墨烯-python。 下面我用vue-apollo做了一个简单的设置: import Vue from 'vue'
import { ApolloClient } from 'apollo-client'
import { HttpLink } from 'apollo-link-http'
import { InMemoryCache } from 'apollo-cache-inmemory'
i
在模拟器上运行。
Error: Network error: Network request failed
at new ApolloError (bundle.umd.js:92)
at Object.error (bundle.umd.js:1323)
at notifySubscription (Observable.js:134)
at onNotify (Observable.js:165)
at SubscriptionObserver.error (Observable.js:224)
at bundle.umd.js:1100
我刚接触apollo-link-state,并且被困了一段时间。我要解决的问题很简单,只需将模态信息保存到本地状态,但是,当我尝试保存到时,它会抱怨:
ApolloError.js?f55daa5:36 Uncaught (in promise) Error: Network error: Cannot read property 'selections' of null
at new ApolloError (ApolloError.js?f55daa5:36)
at Object.error (QueryManager.js?8f5ff47:115)
我是graphql与angular的新手,我的代码有一些问题
我想在我的数据库中存储一些数据,也就是注册页面,但我在控制台中不断收到此错误
ERROR Error: Network error: Cannot read property 'length' of null
at new ApolloError (bundle.esm.js:63)
at Object.error (bundle.esm.js:1030)
at notifySubscription (Observable.js:134)
at onNotify (Observable.js:165)
at Subs
我正在用阿波罗设置服务器端呈现,以便在服务器端设置graphql,但我现在不知道如何遇到这个问题,当我尝试在侧使用查询时,这个错误出现在cli中的一个组件:
(node:4440) UnhandledPromiseRejectionWarning: Error: Network error: Only absolute URLs are supported
at new ApolloError (G:\Project\node_modules\apollo-client\bundle.umd.js:59:32)
at QueryManager.<anonymous> (G:
我正在尝试创建一个自定义ApolloLink,它将特定的graphql数据转换为一个将传递给onError链接的错误。omg help!错误作为网络错误成功地传递给onError,但我在浏览器中也得到了一个运行时错误:不应该发生的Uncaught (in promise) Error: omg help! at new ApolloError。如何确保错误完全在onError中处理,而不从TransformErrorLink代码中抛出运行时错误?
TransformErrorLink.js:
import { ApolloLink, Observable } from 'apollo-
我正在写一个简单的登录表单使用GraphQL和阿波罗。每次用户登录后,它都会重新获取查询以获取用户数据。
import React, {Component} from 'react'
import AuthForm from './AuthForm'
import loginMutation from '../mutations/Login'
import { graphql } from 'react-apollo'
import userQuery from '../queries/CurrentUser'
我刚接触React-apollo,我只是想弄清楚如何使用apollo进行服务器端渲染,它总是抛给我一个错误404,我非常确定我的grapiql端点正在工作。
这是我的错误
{ Error: Network error: Network request failed with status 404 - "Not Found"
at new ApolloError (C:\Users\arfo\Desktop\all folder\FinalHustleBoilerPlate\node_modules\apollo-client\src\errors\ApolloError
我正在使用apollo客户端设置一个新的前端,但我收到了一个错误: Error: Network error: link.request is not a function
at new ApolloError (bundle.esm.js:63)
at ObservableQuery../node_modules/apollo-client/bundle.esm.js.ObservableQuery.getCurrentResult (bundle.esm.js:159)
at ObservableQuery../node_modules/apollo-client
因此,我正在尝试让Apollo服务器与现有的Meteor项目协同工作。在我的项目目录中,我运行
meteor add apollo
meteor npm install --save apollo-client graphql-server-express express graphql
graphql-tools body-parser
将Apollo添加到我的项目中,并安装我稍后需要的所有依赖项。当我尝试在imports/startup/index.js文件中创建我的Apollo服务器时,我得到以下错误
TypeError: createApolloServer is not a fun
我在我的上使用GraphQL和阿波罗,我的查询运行得很好,但是当我尝试运行一个突变(在浏览器上使用完全相同的代码)时,我会得到以下错误:
Error: Network error: Response not successful: Received status code 400
at new ApolloError (bundle.umd.js:76)
at bundle.umd.js:952
at bundle.umd.js:1333
at Array.forEach (<anonymous>)
at bundle.umd.js:1332