Skip to content

Commit 0af5104

Browse files
authored
Add API Platform to the Code page (PHP)
1 parent e79f699 commit 0af5104

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

site/code/index.html.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,44 @@ Apollo Server also supports all Node.js HTTP server frameworks: Express, Connect
305305
- [graphql-php](https://github.com/webonyx/graphql-php): A PHP port of GraphQL reference implementation
306306
- [graphql-relay-php](https://github.com/ivome/graphql-relay-php): A library to help construct a graphql-php server supporting react-relay.
307307
308+
#### [API Platform](https://api-platform.com) ([github](https://github.com/api-platform/api-platform))
309+
310+
API Platform is a fully-featured, flexible and extensible API framework built on top of Symfony.
311+
The following class is enough to create both a Relay-compatible GraphQL server and a hypermedia API supporting modern REST formats (JSON-LD, JSONAPI...):
312+
313+
\`\`\`php
314+
<?php
315+
316+
namespace App\Entity;
317+
318+
use ApiPlatform\Core\Annotation\ApiResource;
319+
use Doctrine\ORM\Mapping as ORM;
320+
321+
/**
322+
* Greet someone!
323+
*
324+
* @ApiResource
325+
* @ORM\Entity
326+
*/
327+
class Greeting
328+
{
329+
/**
330+
* @ORM\Id
331+
* @ORM\Column(type="guid")
332+
*/
333+
public $id;
334+
335+
/**
336+
* @var string Your nice message
337+
*
338+
* @ORM\Column
339+
*/
340+
public $hello;
341+
}
342+
\`\`\`
343+
344+
Other API Platform features include data validation, authentication, authorization, deprecations, cache and GraphiQL integration.
345+
308346
#### [Siler](https://siler.leocavalcante.com/graphql/) ([github](https://github.com/leocavalcante/siler))
309347
310348
Siler is a PHP library powered with high-level abstractions to work with GraphQL.

0 commit comments

Comments
 (0)