现在我正在尝试在typescript中同时使用apolloClient和graphql和rest api。
因此,我应用了apollo-link-rest。但是我得到了下面的错误。
./node_modules/apollo-link-rest/bundle.umd.js找不到模块:无法在'D:\forked\syntegrate_app_client\node_modules\apollo-link-rest‘中解析'graphql-anywhere/lib/async’
Type 'RestLink' is not assignable to type
我是以编程方式使用graphql codegen的。
import * as typescriptReactApolloPlugin from "@graphql-codegen/typescript-react-apollo";
const config: Types.GenerateOptions = {
documents: [{ document: doc }],
config: {},
// returns the string output, rather than writing to a file
filename: "index.ts
运行apollo client:codegen时,我得到以下错误:
✔ Loading Apollo Project
✖ Generating query files with 'typescript' target
→ Can only create NonNull of a Nullable GraphQLType but got: ID.
Error: Can only create NonNull of a Nullable GraphQLType but got: ID.
at invariant (~/Code/humu/node_modul
我在我的反应本机(类型记录) redux项目中使用redux-thunk。我使用thunkWithExtraArgument帮助器提供我的阿波罗客户端变量的引用,因为我得到了返回函数的三个参数,即
...
return async (dispatch, getState, client) =>
...
// and with typescript
import { NormalizedCacheObject } from 'apollo-cache-inmemory'
import ApolloClient from 'apollo-client'
im
我正在尝试显式地向useMutation提供一个客户端。一切正常,除了typescript似乎看到一个类型不匹配的事实。 Type 'DefaultClient<unknown>' is not assignable to type 'ApolloClient<object>'. 客户端与阿波罗的token authentication documentation中所示的客户端非常相似 import { ApolloClient } from 'apollo-client';
import { createHttpLin
我找到了一些关于如何用react-apollo模拟常规查询的资源。示例代码如下:
import ApolloClient from 'apollo-client';
import { ApolloProvider } from 'react-apollo';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { addMockFunctionsToSchema, makeExecutableSchema } from 'graphql-tools';
co
这是我第一次尝试打字。我希望youtube用户auth教程,这是处理令牌刷新-链接。我遇到了一个问题,但教程视频没有这个问题,我不知道如何解决它。
以下是错误日志:
H:/jwt-auth/web/src/index.tsx
TypeScript error in H:/jwt-auth/web/src/index.tsx(48,5):
Type 'TokenRefreshLink<string>' is not assignable to type 'ApolloLink'.
Types of property 'split' ar
我试图将指令添加到我们的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