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 GraphQL changes between 3.x and 4.x #2572

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
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
5 changes: 4 additions & 1 deletion 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 All @@ -392,7 +396,6 @@ figcaption {
font-style: italic;
text-align: center;
}

a.external:not(.card):after {
content: url(../images/open-in-new.svg);
font-style: normal;
Expand Down
55 changes: 55 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,61 @@ 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 |
|:-----------------------------|:--------------------------|
| `id` | `contentId` |
| `_info` | `_contentInfo` |
| `FolderContent` | `FolderItem` |
| `<ContentType>Content` | `<ContentType>Item` |
| `createFolderContent` | `createFolderItem` |
| `create<ContentType>Content` | `create<ContentType>Item` |
Comment on lines +185 to +186
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems it's only createFolder on bot sides…


TODO: Example with more renamed elements

Example of 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 {
name
}
}
}
}
```
</td><td class="compare">
```graphql
{
content {
folder(contentId: 1) {
_contentInfo{
name
}
}
}
}
```
</td></tr>
</tbody></table>

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