From 49640fc739f9d2cdf3bbe0370199802e319c7060 Mon Sep 17 00:00:00 2001 From: Tom H Anderson Date: Sat, 8 Sep 2018 17:08:16 -0600 Subject: [PATCH] Documentation for custom mapping types --- docs/custommappingtypes.rst | 27 +++++++++++++++++++++++++++ docs/index.rst | 1 + 2 files changed, 28 insertions(+) create mode 100644 docs/custommappingtypes.rst diff --git a/docs/custommappingtypes.rst b/docs/custommappingtypes.rst new file mode 100644 index 0000000..7bc21fd --- /dev/null +++ b/docs/custommappingtypes.rst @@ -0,0 +1,27 @@ +Custom Mapping Types +==================== + +Doctrine allows `Custom Mapping Types `_ +To support Custom Mapping Types you must implement ''ZF\Doctrine\GraphQL\Type\CustomTypeInterface'' +on your Custom Doctrine Mapping Type field. This must return a scalar GraphQL type for the custom type. + +Additionally you must create a custom GraphQL type for the field for handling serialization, etc. +See ''ZF\Doctrine\GraphQL\Type\DateTimeType'' for an example of a custom GraphQL type. + +Add the new custom GraphQL type to your configuration:: + + 'zf-doctrine-graphql-type' => [ + 'invokables' => [ + 'datetime_microsecond' => Types\GraphQL\DateTimeMicrosecondType::class, + ], + ], + + +.. 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 a3ebbf6..c8c4f03 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,6 +17,7 @@ schema, if you wish, allowing deep GraphQL queries on your data with a single en hydrators queries events + custommappingtypes graphiql internals