Cal*_*way 4 graphql apollo-server prisma-graphql graphql-playground
我正在使用 Apollo 服务器来实现 GraphQL API,它会自动为我提供一个 GraphQL Playground。根据GraphQL Playground 文档,我应该拥有(或至少能够启用)一个“共享”功能,该功能将创建一个 GraphQL Bin 链接(例如https://graphqlbin.com/OksD),我可以将其发送给同事,以便他们可以查看并运行我的相同查询。
不幸的是,这不能从 Apollo 服务器开箱即用。我如何启用此功能?如果这是不可能的,是否有另一种简单的方法可以让我从 GraphQL Playground 导出查询以供其他人导入?(我看到“复制卷曲”选项,但我没有看到从卷曲导入的简单方法。)
添加shareEnabled: true
到您的游乐场选项,例如
const apolloServer = new ApolloServer({
schema,
debug: isDevelopment,
introspection: isDevelopment,
playground: {
shareEnabled: true,
},
});
Run Code Online (Sandbox Code Playgroud)
您可能还想修复 CORS 原始标头,允许来自https://graphqlbin.com
归档时间: |
|
查看次数: |
1071 次 |
最近记录: |