Skip to content

Commit

Permalink
Documentation for custom mapping types
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHAnderson committed Sep 8, 2018
1 parent 75788aa commit 49640fc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/custommappingtypes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Custom Mapping Types
====================

Doctrine allows `Custom Mapping Types <https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/cookbook/custom-mapping-types.html>`_
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 <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 @@ -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

Expand Down

0 comments on commit 49640fc

Please sign in to comment.