Skip to content

Commit fd18c6b

Browse files
adriendupuismnocon
andcommitted
Document some GraphQL changes between 3.3 and 4.x (#2595)
--------- Co-authored-by: Marek Nocoń <[email protected]> (cherry picked from commit f21a29c)
1 parent 35c8068 commit fd18c6b

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

docs/css/custom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,10 @@ ul li li li {
379379
background-color: var(--table-header);
380380
}
381381

382+
.md-typeset table td.compare {
383+
border: 0.05rem solid var(--md-typeset-table-color)
384+
}
385+
382386
.md-nav__link[data-md-state=blur] {
383387
color: rgb(19, 28, 38);
384388
}

docs/update_and_migration/from_3.3/to_4.0.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,56 @@ php bin/console ibexa:migrations:migrate
144144

145145
## Update your custom code
146146

147+
### GraphQL
148+
149+
Some GraphQL names have changed. Adapt your queries according to the table below.
150+
151+
| 3.3 name | 4.0 name |
152+
|:--------------------------------------------------|:--------------------------------------------|
153+
| `id` argument | `contentId` argument |
154+
| `_info` content item property | `_contentInfo` content item property |
155+
| `<ContentType>Content` (example: `FolderContent`) | `<ContentType>Item` (example: `FolderItem`) |
156+
157+
Example of an updated query:
158+
159+
<table>
160+
<thead><tr><th scope="col">3.3</th><th scope="col">4.0</th></tr></thead>
161+
<tbody>
162+
<tr><td class="compare">
163+
```graphql
164+
{
165+
content {
166+
folder(id: 1) {
167+
_info {
168+
id
169+
name
170+
}
171+
}
172+
}
173+
}
174+
```
175+
</td><td class="compare">
176+
```graphql
177+
{
178+
content {
179+
folder(contentId: 1) {
180+
_contentInfo{
181+
id
182+
name
183+
}
184+
}
185+
}
186+
}
187+
```
188+
</td></tr>
189+
</tbody></table>
190+
191+
Notice that the argument have been updated to `contentId` while the `id` property keeps its name.
192+
193+
While revisiting GraphQL queries, you may consider the new feature `item`
194+
allowing to fetch a content item without knowing its content type.
195+
For more information, see [Get a content item](https://doc.ibexa.co/en/4.6/api/graphql/graphql_queries/#get-a-content-item).
196+
147197
### Back Office customization
148198

149199
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/).

0 commit comments

Comments
 (0)