Skip to content

Commit 0ee3013

Browse files
authored
Merge pull request graphql#544 from dunglas/patch-1
Add API Platform to the Code page (PHP)
2 parents 1958e98 + 0af5104 commit 0ee3013

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
@@ -312,6 +312,44 @@ Apollo Server also supports all Node.js HTTP server frameworks: Express, Connect
312312
- [graphql-php](https://github.com/webonyx/graphql-php): A PHP port of GraphQL reference implementation
313313
- [graphql-relay-php](https://github.com/ivome/graphql-relay-php): A library to help construct a graphql-php server supporting react-relay.
314314
315+
#### [API Platform](https://api-platform.com) ([github](https://github.com/api-platform/api-platform))
316+
317+
API Platform is a fully-featured, flexible and extensible API framework built on top of Symfony.
318+
The following class is enough to create both a Relay-compatible GraphQL server and a hypermedia API supporting modern REST formats (JSON-LD, JSONAPI...):
319+
320+
\`\`\`php
321+
<?php
322+
323+
namespace App\Entity;
324+
325+
use ApiPlatform\Core\Annotation\ApiResource;
326+
use Doctrine\ORM\Mapping as ORM;
327+
328+
/**
329+
* Greet someone!
330+
*
331+
* @ApiResource
332+
* @ORM\Entity
333+
*/
334+
class Greeting
335+
{
336+
/**
337+
* @ORM\Id
338+
* @ORM\Column(type="guid")
339+
*/
340+
public $id;
341+
342+
/**
343+
* @var string Your nice message
344+
*
345+
* @ORM\Column
346+
*/
347+
public $hello;
348+
}
349+
\`\`\`
350+
351+
Other API Platform features include data validation, authentication, authorization, deprecations, cache and GraphiQL integration.
352+
315353
#### [Siler](https://siler.leocavalcante.com/graphql/) ([github](https://github.com/leocavalcante/siler))
316354
317355
Siler is a PHP library powered with high-level abstractions to work with GraphQL.

0 commit comments

Comments
 (0)