From cc6a63925c0de14a4f61562c33e35f4868f180ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Tue, 30 Sep 2025 15:19:13 +0200 Subject: [PATCH] URL fieldtype - GraphQL integration --- docs/api/graphql/graphql_queries.md | 4 ++ .../field_type_reference/urlfield.md | 72 +++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/docs/api/graphql/graphql_queries.md b/docs/api/graphql/graphql_queries.md index a4efa75763..2f28f4d99f 100644 --- a/docs/api/graphql/graphql_queries.md +++ b/docs/api/graphql/graphql_queries.md @@ -842,3 +842,7 @@ To get a Matrix field type with GraphQL, see [Matrix field type reference](matri ### Enable pagination for RelationList field type To learn how to enable pagination for RelationList field type, see the [RelationList field type reference](relationlistfield.md). + +### Url field type integration + +To learn how to customize the URL field type when using GraphQL, see the [URL field type reference](urlfield.md#graphql-integration). diff --git a/docs/content_management/field_types/field_type_reference/urlfield.md b/docs/content_management/field_types/field_type_reference/urlfield.md index b9ead6f12c..e786a80d37 100644 --- a/docs/content_management/field_types/field_type_reference/urlfield.md +++ b/docs/content_management/field_types/field_type_reference/urlfield.md @@ -68,3 +68,75 @@ This field type doesn't perform validation. ### Settings This field type doesn't have settings. + +## GraphQL integration + +To access the `link` and `text` properties in GraphQL responses, set the `ibexa.graphql.schema.should.extend.ezurl` parameter to `true`. + +!!! note + + This behaviour is enabled by default in [[= product_name =]] v5 and the parameter is removed. + +Compare the examples below: + + + + + + + + + + +
Parameter valueRequestResponses
Disabled +```graphql +{ + content { + article(contentId: 76) { + url_field + } + } +} +``` + +```graphql +{ + "data": { + "content": { + "article": { + "url_field": "https://example.com" + } + } + } +} +``` +
Enabled +```graphql +{ + content { + article(contentId: 76) { + url_field { + text + link + } + } + } +} + +``` + +```graphql +{ + "data": { + "content": { + "article": { + "field68dbd09357392": { + "text": "Example", + "link": "https://example.com" + } + } + } + } +} +``` +