我目前正尝试在useEffect钩子中使用来自阿波罗v3的useSubscription钩子来更新GraphQL订阅:
let containerSubscription = useSubscription<CreatedDateSubscription, CreatedDateSubscriptionVariables>(
gql(containerUpdatedOnCreatedDate),
{
variables: { createdDate: selectedDate },
shouldResubscribe: true, // is this ne
我正在构建一个使用@apollo/client v3的react本机应用程序(使用类型记录)。我有许多变异&查询,它们都返回相同的类型,并且我总是希望接收相同的字段。因此,我为模式定义(在客户机中)提供了以下结构:
import { gql } from "@apollo/client";
gql`
fragment ConversationFragment on Conversation {
roomId
name
isDirect
participants {
id
isAdmin
isCre
我只是想知道这种看似笨拙的配置(来自)的原因是什么?
const server = new ApolloServer({
// These will be defined for both new or existing servers
typeDefs,
resolvers,
});
server.applyMiddleware({ app }); // app is from an existing express app
为什么我调用.applyMiddleware()并提供给它我的app,而不是使用,它甚至从文档中看起来阿波罗只在/graphql上回答请求,
let ap
keepAlive在阿波罗订阅方面遇到了一些麻烦。每当我将时间设置为秒或更多秒时,侦听订阅错误就会退出。
{
"error": "Could not connect to websocket endpoint ws://website.test:8000/graphql. Please check if the endpoint url is correct."
}
这是ApolloServer设置
const apollo = new ApolloServer({
introspection: true,
playground: true,
我最近更新了角阿波罗从2.6.0到v3.0.0,这个更新打破了我的测试。
我在单元测试中使用jest,虽然应用程序编译和运行良好,但我的测试无法从“阿波罗角”导入任何依赖项,并且我会收到如下错误:
Test suite failed to run
Cannot find module 'apollo-angular' from 'src/graphql/generated/graphql.ts'
Require stack:
src/graphql/generated/graphql.ts
src/app/page
我正在使用带有apollo/client的组合api的vue 3。我从文档开始做了所有的事情,但这是我能做的最多了。我提供了一个正确的后端url,但我不能确定它是我的代码,out.This是我的代码,我在终端中得到一个警告。
./node_modules/@vue/apollo-composable/dist/useQuery.js中的警告
在浏览器控制台中,我得到了这个错误。
Uncaught Error: Apollo client with id default not found. Use provideApolloClient() if you are outside of a c
我正在使用apollo-fetch来获取graphql数据。我在一个脚本错误中结束,请求没有通过。我不确定像这样一个相当简单的请求出了什么问题。请帮帮忙。
下面是错误:
Uncaught (in promise) Error: Network request failed to return valid JSON
at throwHttpError (apollo-fetch.js:41)
at apollo-fetch.js:141
at <anonymous>
throwHttpError @ apollo-fetch.js:41
(an