Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document some GraphQL changes between 3.3 and 4.x #2595

Merged
merged 17 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions docs/api/graphql/graphql_queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
}
}
```
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions docs/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
50 changes: 50 additions & 0 deletions docs/update_and_migration/from_3.3/to_4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,56 @@ php bin/console ibexa:migrations:migrate

## Update your custom code

### GraphQL

Some GraphQL property names have changed. Adapt your queries according to the table below.
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved

| 3.3 name | 4.0 name |
|:--------------------------------------------------|:--------------------------------------------|
| `id` argument | `contentId` argument |
| `_info` | `_contentInfo` |
adriendupuis marked this conversation as resolved.
Show resolved Hide resolved
| `<ContentType>Content` (example: `FolderContent`) | `<ContentType>Item` (example: `FolderItem`) |

Example of an updated query:

<table>
<thead><tr><th scope="col">3.3</th><th scope="col">4.0</th></tr></thead>
<tbody>
<tr><td class="compare">
```graphql
{
content {
folder(id: 1) {
_info {
id
name
}
}
}
}
```
</td><td class="compare">
```graphql
{
content {
folder(contentId: 1) {
_contentInfo{
id
name
}
}
}
}
```
</td></tr>
</tbody></table>

Notice that the argument have been updated to `contentId` while the `id` property keeps its name.

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/).
Expand Down
Loading