leeroy/sail-graphql-playground

SailCMS 的 GraphQL Playground

v1.0.2 2023-05-02 17:08 UTC

This package is auto-updated.

Last update: 2024-10-01 00:14:58 UTC


README

此包提供了用于开发期间测试的 GraphQL 图形用户界面。它使用了 graphql/graphql-playground 库。

安装

php sail install:official leeroy/sail-graphql-playground

这将使用 composer 安装包,然后更新您的 composer 文件来自动加载包。

如果您想手动安装,请执行以下操作

composer require leeroy/sail-graphql-playground

之后,您可以将 Leeroy\\GraphQLPlayground 添加到 composer.json 文件中 sailcms 属性的模块部分。它应该看起来像这样

"sailcms": {
  "containers": ["Spec"],
  "modules": [
    "Leeroy\\GraphQLPlayground"
  ],
  "search": {}
}

配置

安装后,您需要将以下内容添加到您的 .env 文件中。

GRAPHQL_PLAYGROUND=true

使用

从您项目的 URL 中打开 /graphql URL。您就可以开始使用了!