dr-schopalopp/graphiql-middleware 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dr-schopalopp/graphiql-middleware

Composer 安装命令:

composer require dr-schopalopp/graphiql-middleware

包简介

GraphiQL PSR-15 Middleware based on https://github.com/graphql/graphiql

README 文档

README

Latest Version Software License

Add a GraphiQL interface to your application with this PSR-15 middleware.

This is basically a copy of graphiql-middleware adjusted for PSR-15.

Install

composer require dr-schopalopp/graphiql-middleware

Usage

This middleware was developed in a slim project, but it should work with any other PSR-15 compatible framework.

Slim 4

// app/dependencies.php

use DrSchopalopp\GraphiQLMiddleware\GraphiQLMiddleware;

return function (ContainerBuilder $containerBuilder) {
    $containerBuilder->addDefinitions([
        // ...
        
        GraphiQLMiddleware::class => function () {
            return new GraphiQLMiddleware();
        }
        
        // ...
    ]);
};
// app/middleware.php

use DrSchopalopp\GraphiQLMiddleware\GraphiQLMiddleware;

return function (App $app) {
    // ...
    
    $app->add(GraphiQLMiddleware::class);
    
    // ...
};
// app/routes.php

return static function (App $app) {
    // ...

    // dummy route necessary otherwise you will get an HTTP 405 Method Not Allowed error 
    $app->get('/graphiql', function (Request $request, Response $response) {
        return $response;
    });
    
    // ...
};

see HTTP 405 Method Not Allowed for details

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: HTML

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固