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