最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Express

运维笔记admin24浏览0评论

Express

Express

Lat*_*man 6

好的,我不确定发生了什么,但我似乎解决了这个问题。

我的想法是:GraphQL Playground 已退役,并且 localhost:port/graphql 现在重定向到 Apollo GraphQL Sandbox 到不同的 url,我的猜测是 cookie 没有被传输到这个位置,但 cookie 设置在 localhost。

所以有一种方法可以通过添加以下内容来强制 Apollo 仍然使用 Playground:

import { ApolloServerPluginLandingPageGraphQLPlayground } from "apollo-server-core"; const apolloServer = new ApolloServer({ ..., plugins: [ ApolloServerPluginLandingPageGraphQLPlayground({ // options }), ], });

这样 Playground 就会出现,你可以设置

"request.credentials": "include",

在设置中,瞧,cookie 显示在 localhost:port 中。

我希望这可以帮助解决这个问题的任何人 - 但是我仍然不确定这是一个正确的解决方案。

Express

发布评论

评论列表(0)

  1. 暂无评论