-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from TomHAnderson/feature/graphiql-docs
Added docs for documenting the types
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
Documenting Your Entities | ||
========================= | ||
|
||
Introspection of entities is a core component to GraphQL. The introspection allows you to | ||
document your types. Because entities are types there is a section inside each | ||
hydrator configuration for documenting your entity and fields through introspection. | ||
|
||
|
||
.. code-block:: php | ||
'documentation' => [ | ||
'_entity' => 'The Artist entity contains bands, groups, and individual performers.', | ||
'performance' => 'A collection of Performances by the Artist', | ||
'artistGroup' => 'Artist Groups this Artist belongs to.', | ||
'name' => 'The name of the performer.', | ||
'icon' => 'The Artist icon', | ||
'createdAt' => 'DateTime the Artist record was created', | ||
'abbreviation' => 'An abbreviation for the Artist', | ||
'description' => 'A description of the Artist', | ||
'id' => 'Primary Key for the Artist', | ||
], | ||
There is one special field, `_entity` which is the description for the entity itself. | ||
The rest of the fields describe documentation for each field. | ||
|
||
Documentation is specific to each hydrator section allowing you to describe the same entity | ||
in different ways. The Documentation will be returned in tools like `GraphiQL <https://github.com/graphql/graphiql>`_ | ||
|
||
GraphiQL is the standard for browsing introspected GraphQL types. zf-doctrine-graphql fully supports | ||
GraphiQL. | ||
|
||
|
||
|
||
.. role:: raw-html(raw) | ||
:format: html | ||
|
||
.. note:: | ||
Authored by `API Skeletons <https://apiskeletons.com>`_. All rights reserved. | ||
|
||
|
||
:raw-html:`<script async src="https://www.googletagmanager.com/gtag/js?id=UA-64198835-4"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-64198835-4');</script>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters