在LoopBack 4中使用GraphQL Playground

动机

为了省去向客户展示Excel规范文档等的麻烦,我们希望提供尽可能简单易懂的用户界面。另外,GraphiQL无法发送头文件。

步骤

将Loopback4启动在3001端口上。

使用 openapi-to-graphql 在 3000 端口上进行启动。

下载 https://github.com/prisma/graphql-playground/blob/master/packages/graphql-playground-html/withAnimation.html 文件,并将其放入自己的 Loopback 应用的 public 目录中。

用类似的方式访问:http://localhost:3000/withAnimation.html?endpoint=http://localhost:3000/graphql (模糊记忆)。

bannerAds