From ef71fd9b64517c53728d839ebe7bd3eaf8cefc48 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:13:37 +0100 Subject: [PATCH 1/9] to_4.0.md: Draft doc about GraphQL update --- docs/update_and_migration/from_3.3/to_4.0.md | 42 ++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/docs/update_and_migration/from_3.3/to_4.0.md b/docs/update_and_migration/from_3.3/to_4.0.md index 4566dad378..27e9003616 100644 --- a/docs/update_and_migration/from_3.3/to_4.0.md +++ b/docs/update_and_migration/from_3.3/to_4.0.md @@ -168,6 +168,48 @@ php bin/console ibexa:migrations:migrate ## Update your custom code +### GraphQL + +TODO: Confirm it happens between 3.3 and 4.0 + +Some property names has changed and your GraphQL queries need to be updated. + +TODO: Complete the list of renamed elements + +| 3.3 name | 4.0 name | +|:---------|:---------| +|`_info`|`_contentInfo`| + +TODO: Example with more renamed elements + +Example of updated query + +
+```graphql +{ + content { + folder(id: 1) { + _info { + name + } + } + } +} +``` + +```graphql +{ + content { + folder(contentId: 1) { + _contentInfo{ + name + } + } + } +} +``` +
+ ### Back office customization The v4 version of [[= product_name =]] is using Bootstrap 5 in the back office. If you were using Bootstrap 4 for styling, you need to update and adjust all custom back office components [following the migration guide from Bootstrap 4](https://getbootstrap.com/docs/5.0/migration/). From 79ad34df190b8f7bb13649a33a8b4a4f3c334b38 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:50:57 +0100 Subject: [PATCH 2/9] to_4.0.md: Add few renamed elements --- docs/css/custom.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/css/custom.css b/docs/css/custom.css index 198fc77a76..2a66a4a4b9 100644 --- a/docs/css/custom.css +++ b/docs/css/custom.css @@ -393,6 +393,10 @@ figcaption { text-align: center; } +a.external:not(.card) { + white-space: nowrap; +} + a.external:not(.card):after { content: url(../images/open-in-new.svg); font-style: normal; From 2ceaf9a17ee9b5b81da25f14bed91d98a6be9ac0 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 9 Dec 2024 16:18:38 +0100 Subject: [PATCH 3/9] to_4.0.md: Add few more renamed elements --- docs/css/custom.css | 4 ++ docs/update_and_migration/from_3.3/to_4.0.md | 63 ++++++++++++++++++-- 2 files changed, 61 insertions(+), 6 deletions(-) diff --git a/docs/css/custom.css b/docs/css/custom.css index 2a66a4a4b9..437b6cf194 100644 --- a/docs/css/custom.css +++ b/docs/css/custom.css @@ -379,6 +379,10 @@ ul li li li { background-color: var(--table-header); } +.md-typeset table td.compare { + border: 0.05rem solid var(--md-typeset-table-color) +} + .md-nav__link[data-md-state=blur] { color: rgb(19, 28, 38); } diff --git a/docs/update_and_migration/from_3.3/to_4.0.md b/docs/update_and_migration/from_3.3/to_4.0.md index 27e9003616..ae331e0e49 100644 --- a/docs/update_and_migration/from_3.3/to_4.0.md +++ b/docs/update_and_migration/from_3.3/to_4.0.md @@ -176,15 +176,23 @@ Some property names has changed and your GraphQL queries need to be updated. TODO: Complete the list of renamed elements -| 3.3 name | 4.0 name | -|:---------|:---------| -|`_info`|`_contentInfo`| +| 3.3 name | 4.0 name | +|:-----------------------------|:--------------------------| +| `id` | `contentId` | +| `_info` | `_contentInfo` | +| `FolderContent` | `FolderItem` | +| `Content` | `Item` | +| `createFolderContent` | `createFolderItem` | +| `createContent` | `createItem` | TODO: Example with more renamed elements Example of updated query - + + +
+ + + +
3.34.0
```graphql { content { @@ -196,7 +204,7 @@ Example of updated query } } ``` - + ```graphql { content { @@ -208,7 +216,50 @@ Example of updated query } } ``` -
+
The following query is made for several content types, and the content or location ID is injected before requesting it. +
+For example, `$criterion='locationId: 2';`
+``` +{ + item ($criterion) { + ... on FolderContent { + name + } + ... on LandingPageContent { + name + } + ... on ArticleContent { + title + intro { + html5 + } + } + } +} +``` + +``` +{ + item ($criterion) { + ... on FolderContent { + name + } + ... on LandingPageContent { + name + } + ... on ArticleContent { + title + intro { + html5 + } + } + } +} +``` +
### Back office customization From d6b4326cfd2d28718be9ece10f49c98037d8f6d2 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 9 Dec 2024 16:19:37 +0100 Subject: [PATCH 4/9] to_4.0.md: Add few more renamed elements --- docs/update_and_migration/from_3.3/to_4.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/update_and_migration/from_3.3/to_4.0.md b/docs/update_and_migration/from_3.3/to_4.0.md index ae331e0e49..1ce907a3aa 100644 --- a/docs/update_and_migration/from_3.3/to_4.0.md +++ b/docs/update_and_migration/from_3.3/to_4.0.md @@ -219,7 +219,7 @@ Example of updated query The following query is made for several content types, and the content or location ID is injected before requesting it.
-For example, `$criterion='locationId: 2';` +For example, $criterion='locationId: 2'; ``` { From 843d28eb5b22f24b502c8dd64c9d39c3d2b3bb5b Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Mon, 9 Dec 2024 16:20:35 +0100 Subject: [PATCH 5/9] to_4.0.md: Add few more renamed elements --- docs/update_and_migration/from_3.3/to_4.0.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/update_and_migration/from_3.3/to_4.0.md b/docs/update_and_migration/from_3.3/to_4.0.md index 1ce907a3aa..6092846e43 100644 --- a/docs/update_and_migration/from_3.3/to_4.0.md +++ b/docs/update_and_migration/from_3.3/to_4.0.md @@ -242,14 +242,14 @@ For example, $criterion='locationId: 2'; ``` { - item ($criterion) { - ... on FolderContent { + item (locationId: 2) { + ... on FolderItem { name } - ... on LandingPageContent { + ... on LandingPageItem { name } - ... on ArticleContent { + ... on ArticleItem { title intro { html5 From 5b8220df66d59c4d4e45f9b51d7af2f43fbc266e Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:12:48 +0100 Subject: [PATCH 6/9] GraphQL: item() was introduced in 4.x --- docs/update_and_migration/from_3.3/to_4.0.md | 46 ++------------------ 1 file changed, 4 insertions(+), 42 deletions(-) diff --git a/docs/update_and_migration/from_3.3/to_4.0.md b/docs/update_and_migration/from_3.3/to_4.0.md index 6092846e43..b5f7704add 100644 --- a/docs/update_and_migration/from_3.3/to_4.0.md +++ b/docs/update_and_migration/from_3.3/to_4.0.md @@ -217,50 +217,12 @@ Example of updated query } ``` -The following query is made for several content types, and the content or location ID is injected before requesting it. -
-For example, $criterion='locationId: 2'; - -``` -{ - item ($criterion) { - ... on FolderContent { - name - } - ... on LandingPageContent { - name - } - ... on ArticleContent { - title - intro { - html5 - } - } - } -} -``` - -``` -{ - item (locationId: 2) { - ... on FolderItem { - name - } - ... on LandingPageItem { - name - } - ... on ArticleItem { - title - intro { - html5 - } - } - } -} -``` - +While revisiting GraphQL queries, you may consider the new feature `item` +allowing to fetch a content item without knowing its content type. +For more information, see [Get a content item](graphql_queries.md#get-a-content-item) + ### Back office customization The v4 version of [[= product_name =]] is using Bootstrap 5 in the back office. If you were using Bootstrap 4 for styling, you need to update and adjust all custom back office components [following the migration guide from Bootstrap 4](https://getbootstrap.com/docs/5.0/migration/). From c4132d77e933353b9715d4f65c7ac3cdfb751004 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 16 Jan 2025 12:01:13 +0100 Subject: [PATCH 7/9] graphql_queries.md: extend item example with conditional fields --- docs/api/graphql/graphql_queries.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/api/graphql/graphql_queries.md b/docs/api/graphql/graphql_queries.md index 20513daa6d..d38629b8dd 100644 --- a/docs/api/graphql/graphql_queries.md +++ b/docs/api/graphql/graphql_queries.md @@ -15,7 +15,7 @@ To get a specific content item by its content ID, location ID, or URL alias, use ``` { content { - article (contentId: 62) { + article(contentId: 62) { title author { name @@ -52,8 +52,17 @@ The query accepts `locationId`, `remoteId`, and `urlAlias` as arguments. ``` { - item (locationId: 2) { + item(locationId: 2) { _name + ... on FolderItem { + name + } + ... on LandingPageItem { + name + } + ... on ArticleItem { + title + } } } ``` @@ -181,9 +190,9 @@ To get the IDs and names of all Fields in the `article` content type: { content { _types { - article{ + article { _info { - fieldDefinitions{ + fieldDefinitions { id name } @@ -318,8 +327,8 @@ Alternatively, you can query the `children` property of an `item` or `content` o ``` { - item (locationId: 2) { - _location{ + item(locationId: 2) { + _location { children { edges { node { From b35bc3b192e9e94cf69942cad8382ef6cc8b0b49 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 16 Jan 2025 14:00:05 +0100 Subject: [PATCH 8/9] Update docs/css/custom.css --- docs/css/custom.css | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docs/css/custom.css b/docs/css/custom.css index 437b6cf194..36bf838ac1 100644 --- a/docs/css/custom.css +++ b/docs/css/custom.css @@ -396,11 +396,6 @@ figcaption { font-style: italic; text-align: center; } - -a.external:not(.card) { - white-space: nowrap; -} - a.external:not(.card):after { content: url(../images/open-in-new.svg); font-style: normal; From 905c14f9de2e425d49b25cb499b3c0ab77111e58 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 29 Jan 2025 13:24:23 +0100 Subject: [PATCH 9/9] (minor) reset/format custom.css git checkout master -- docs/css/custom.css --- docs/css/custom.css | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/css/custom.css b/docs/css/custom.css index 36bf838ac1..0c7e4a214c 100644 --- a/docs/css/custom.css +++ b/docs/css/custom.css @@ -396,6 +396,7 @@ figcaption { font-style: italic; text-align: center; } + a.external:not(.card):after { content: url(../images/open-in-new.svg); font-style: normal;