-
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.
Documentation for custom mapping types
- Loading branch information
1 parent
75788aa
commit 49640fc
Showing
2 changed files
with
28 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,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>` |
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