From ee98791e65d3aebd7bf0d3b5b256fbbf183fc44d Mon Sep 17 00:00:00 2001 From: Tom H Anderson Date: Wed, 27 Jun 2018 23:24:40 -0600 Subject: [PATCH] Added docs for documenting the types --- docs/documenting.rst | 41 +++++++++++++++++++++++++++++++++++++++++ docs/index.rst | 1 + 2 files changed, 42 insertions(+) create mode 100644 docs/documenting.rst diff --git a/docs/documenting.rst b/docs/documenting.rst new file mode 100644 index 0000000..4250883 --- /dev/null +++ b/docs/documenting.rst @@ -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 `_ + +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 `_. All rights reserved. + + +:raw-html:`` diff --git a/docs/index.rst b/docs/index.rst index abb09b0..8c9c937 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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