Field is not exposed in GraphQL compose

Created on 15 July 2025, 20 days ago

Problem/Motivation

I've just installed module as it give me exactly what I need in terms of field. However, we use GraphQL compose to extract data. Field created using this module (i.e. Duration field type) is not available in GraphQL compose. It would be nice to include that as a part of a module.

💬 Support request
Status

Active

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom drs2034

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @drs2034
  • 🇬🇧United Kingdom drs2034

    I also notice that this field does not work JSON API and throws error

    TypeError: Drupal\\serialization\\Normalizer\\PrimitiveDataNormalizer::normalize(): Return value must be of type ArrayObject|array|string|int|float|bool|null, DateInterval returned in /var/www/html/drupal/web/core/modules/serialization/src/Normalizer/PrimitiveDataNormalizer.php:36\nStack trace:\n#0 /var/www/html/drupal/vendor/symfony/serializer/Serializer.php(161): Drupal\\serialization\\Normalizer\\PrimitiveDataNormalizer->normalize()\n#1 /var/www/html/drupal/web/core/modules/jsonapi/src/Serializer/Serializer.php(65): Symfony\\Component\\Serializer\\Serializer->normalize()\n#2 /var/www/html/drupal/web/core/modules/jsonapi/src/Normalizer/FieldItemNormalizer.php(67): Drupal\\jsonapi\\Serializer\\Serializer->normalize()\n#3 /var/www/html/drupal/web/modules/contrib/jsonapi_extras/src/Normalizer/JsonApiNormalizerDecoratorBase.php(38): Drupal\\jsonapi\\Normalizer\\FieldItemNormalizer->normalize()\n#4 /var/www/html/drupal/web/modules/contrib/jsonapi_extras/src/Normalizer/FieldItemNormalizer.php(53): Drupal\\jsonapi_extras\\Normalizer\\JsonApiNormalizerDecoratorBase->normalize()\n#5 /var/www/html/drupal/vendor/symfony/serializer/Serializer.php(161): Drupal\\jsonapi_extras\\Normalizer\\FieldItemNormalizer->normalize()\n#6 /var/www/html/drupal/web/core/modules/jsonapi/src/Serializer/Serializer.php(62): Symfony\\Component\\Serializer\\Serializer->normalize()\n#7 /var/www/html/drupal/web/core/modules/jsonapi/src/Normalizer/FieldNormalizer.php(86): Drupal\\jsonapi\\Serializer\\Serializer->normalize()\n#8 /var/www/html/drupal/web/core/modules/jsonapi/src/Normalizer/FieldNormalizer.php(28): Drupal\\jsonapi\\Normalizer\\FieldNormalizer->normalizeFieldItems()\n#9 /var/www/html/drupal/vendor/symfony/serializer/Serializer.php(161): Drupal\\jsonapi\\Normalizer\\FieldNormalizer->normalize()\n#10 /var/www/html/drupal/web/core/modules/jsonapi/src/Serializer/Serializer.php(62): Symfony\\Component\\Serializer\\Serializer->normalize()\n#11 /var/www/html/drupal/web/core/modules/jsonapi/src/Normalizer/ResourceObjectNormalizer.php(181): Drupal\\jsonapi\\Serializer\\Serializer->normalize()\n#12 /var/www/html/drupal/web/core/modules/jsonapi/src/Normalizer/ResourceObjectNormalizer.php(116): Drupal\\jsonapi\\Normalizer\\ResourceObjectNormalizer->serializeField()\n#13 /var/www/html/drupal/web/core/modules/jsonapi/src/Normalizer/ResourceObjectNormalizer.php(68): Drupal\\jsonapi\\Normalizer\\ResourceObjectNormalizer->getNormalization()\n#14 /var/www/html/drupal/web/modules/contrib/jsonapi_extras/src/Normalizer/JsonApiNormalizerDecoratorBase.php(38): Drupal\\jsonapi\\Normalizer\\ResourceObjectNormalizer->normalize()\n#15 /var/www/html/drupal/web/modules/contrib/jsonapi_extras/src/Normalizer/ResourceObjectNormalizer.php(24): Drupal\\jsonapi_extras\\Normalizer\\JsonApiNormalizerDecoratorBase->normalize()\n#16 /var/www/html/drupal/vendor/symfony/serializer/Serializer.php(161): Drupal\\jsonapi_extras\\Normalizer\\ResourceObjectNormalizer->normalize()\n#17 /var/www/html/drupal/web/core/modules/jsonapi/src/Serializer/Serializer.php(62): Symfony\\Component\\Serializer\\Serializer->normalize()\n#18 /var/www/html/drupal/web/core/modules/jsonapi/src/Normalizer/DataNormalizer.php(21): Drupal\\jsonapi\\Serializer\\Serializer->normalize()\n#19 [internal function]: Drupal\\jsonapi\\Normalizer\\DataNormalizer->Drupal\\jsonapi\\Normalizer\\{closure}()\n#20 /var/www/html/drupal/web/core/modules/jsonapi/src/Normalizer/DataNormalizer.php(20): array_map()\n#21 /var/www/html/drupal/vendor/symfony/serializer/Serializer.php(161): Drupal\\jsonapi\\Normalizer\\DataNormalizer->normalize()\n#22 /var/www/html/drupal/web/core/modules/jsonapi/src/Serializer/Serializer.php(62): Symfony\\Component\\Serializer\\Serializer->normalize()\n#23 /var/www/html/drupal/web/core/modules/jsonapi/src/Normalizer/JsonApiDocumentTopLevelNormalizer.php(188): Drupal\\jsonapi\\Serializer\\Serializer->normalize()\n#24 /var/www/html/drupal/vendor/symfony/serializer/Serializer.php(161): Drupal\\jsonapi\\Normalizer\\JsonApiDocumentTopLevelNormalizer->normalize()\n#25 /var/www/html/drupal/web/core/modules/jsonapi/src/Serializer/Serializer.php(62): Symfony\\Component\\Serializer\\Serializer->normalize()\n#26 /var/www/html/drupal/web/core/modules/jsonapi/src/EventSubscriber/ResourceResponseSubscriber.php(120): Drupal\\jsonapi\\Serializer\\Serializer->normalize()\n#27 /var/www/html/drupal/web/core/modules/jsonapi/src/EventSubscriber/ResourceResponseSubscriber.php(85): Drupal\\jsonapi\\EventSubscriber\\ResourceResponseSubscriber->renderResponseBody()\n#28 [internal function]: Drupal\\jsonapi\\EventSubscriber\\ResourceResponseSubscriber->onResponse()\n#29 /var/www/html/drupal/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()\n#30 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(214): Drupal\\Component\\EventDispatcher\\ContainerAwareEventDispatcher->dispatch()\n#31 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(202): Symfony\\Component\\HttpKernel\\HttpKernel->filterResponse()\n#32 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw()\n#33 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\\Component\\HttpKernel\\HttpKernel->handle()\n#34 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\\Core\\StackMiddleware\\Session->handle()\n#35 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\\Core\\StackMiddleware\\KernelPreHandle->handle()\n#36 /var/www/html/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\\Core\\StackMiddleware\\ContentLength->handle()\n#37 /var/www/html/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\\page_cache\\StackMiddleware\\PageCache->pass()\n#38 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\\page_cache\\StackMiddleware\\PageCache->handle()\n#39 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle()\n#40 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\\Core\\StackMiddleware\\NegotiationMiddleware->handle()\n#41 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\\Core\\StackMiddleware\\AjaxPageState->handle()\n#42 /var/www/html/drupal/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\\Core\\StackMiddleware\\StackedHttpKernel->handle()\n#43 /var/www/html/drupal/web/index.php(19): Drupal\\Core\\DrupalKernel->handle()\n#44 {main}\n\nNext Symfony\\Component\\HttpKernel\\Exception\\HttpException: Drupal\\serialization\\Normalizer\\PrimitiveDataNormalizer::normalize(): Return value must be of type ArrayObject|array|string|int|float|bool|null, DateInterval returned in /var/www/html/drupal/web/core/modules/jsonapi/src/EventSubscriber/DefaultExceptionSubscriber.php:49\nStack trace:\n#0 [internal function]: Drupal\\jsonapi\\EventSubscriber\\DefaultExceptionSubscriber->onException()\n#1 /var/www/html/drupal/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()\n#2 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(239): Drupal\\Component\\EventDispatcher\\ContainerAwareEventDispatcher->dispatch()\n#3 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(91): Symfony\\Component\\HttpKernel\\HttpKernel->handleThrowable()\n#4 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\\Component\\HttpKernel\\HttpKernel->handle()\n#5 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\\Core\\StackMiddleware\\Session->handle()\n#6 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\\Core\\StackMiddleware\\KernelPreHandle->handle()\n#7 /var/www/html/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\\Core\\StackMiddleware\\ContentLength->handle()\n#8 /var/www/html/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\\page_cache\\StackMiddleware\\PageCache->pass()\n#9 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\\page_cache\\StackMiddleware\\PageCache->handle()\n#10 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle()\n#11 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\\Core\\StackMiddleware\\NegotiationMiddleware->handle()\n#12 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\\Core\\StackMiddleware\\AjaxPageState->handle()\n#13 /var/www/html/drupal/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\\Core\\StackMiddleware\\StackedHttpKernel->handle()\n#14 /var/www/html/drupal/web/index.php(19): Drupal\\Core\\DrupalKernel->handle()\n#15 {main}"

Production build 0.71.5 2024