知海

PHP:API Platform(服务端)

graphql-github-io-zh-Hans生态项目与库

PHP:API Platform(服务端)

属性
名称 API Platform
描述 API Platform 是一个构建在 Symfony 之上的功能完备、灵活且可扩展的 API 框架。
官网 https://api-platform.com
GitHub api-platform/api-platform

以下类足以同时创建一个兼容 Relay 的 GraphQL 服务器,以及一个支持现代 REST 格式(JSON-LD、JSONAPI 等)的超媒体 API:

php 复制代码
<?php

namespace AppEntity;

use ApiPlatformCoreAnnotationApiResource;
use DoctrineORMMapping as ORM;

/**
 * Greet someone!
 *
 * @ApiResource
 * @ORMEntity
 */
class Greeting
{
    /**
     * @ORMId
     * @ORMColumn(type="guid")
     */
    public $id;

    /**
     * @var string Your nice message
     *
     * @ORMColumn
     */
    public $hello;
}

API Platform 的其他功能包括数据校验、身份验证、授权、弃用管理、缓存和 GraphiQL 集成。

帮助我们改进文档

发现翻译问题或内容错误?请告诉我们。