Skip to content

Commit

Permalink
Merge pull request #17 from TomHAnderson/feature/graphiql-docs
Browse files Browse the repository at this point in the history
Added docs for documenting the types
  • Loading branch information
TomHAnderson authored Jun 28, 2018
2 parents 9383524 + ee98791 commit 9263bc9
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
41 changes: 41 additions & 0 deletions docs/documenting.rst
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>`
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ schema, if you wish, allowing deep GraphQL queries on your data with a single en
about
installation
use
documenting
queries
configuration
events
Expand Down

0 comments on commit 9263bc9

Please sign in to comment.