Query / Create / Update / Delete data in the repository with GraphQL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2021 03:39 PM - edited ‎03-06-2021 03:40 PM
The REST API based on GraphQL allows to perform all actions of the CRUD :
- Create
- Read
- Update
- Delete
This mechanism allows to perform a various kind of action into the repository. Read action are performed with the keyword "query" in GraphQL whereas Read/Update/Delete are performed with the "mutation" keyword.
All the example below are performed with the ITPM schema.
Basics queries
Get an object with it's attributes
- For instance the following query will return the name of the applications
Query | Result |
|
|
Get an object with it's relations
- For instance the following query will return the applications and their related business process
Query | Result |
|
|
Basics mutations
Create an object
- For instance the following mutation will create a new application. If creation is successful the result returned the created object.
Query | Result |
|
|
Create an object with a relationship
- For instance the following mutation will create a new application and link it to an existing business process. If creation is successful the result returned the created object.
Query | Result |
|
|
Updating an object
- For instance the following mutation will update an existing application. If update is successful the result returned the updated object.
Query | Result |
|
|
Delete an object
- For instance the following mutation will delete an existing application. If delete is successful the result returned the number of deleted object.
Query | Result |
|
|
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎29-11-2024 09:09 AM
So far so fine, but how I update for example the creator of an application? This way don't work. It tells creator is not field at application, but if I query applications, I see creator is null or has an object with id, name and other. So how does it work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎19-10-2021 02:08 AM
I need to change a field but in Spanish and with graphql it only changes it in English.
I saw a parameter in the x-hopex-language-data-id header, but I don't get it to work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎19-07-2021 10:49 AM
Hello Hendrik,
As the name are not always unique we cannot use them as a mean to connect 2 objects. That's why we use ID.
You have 3 ways to connect :
- internal ID : for existing object that you already know the object
- external ID : for object that you create and that you have chosen to give an ID to make this type of connection. The ID will be store in the repository
- temporary ID : same as external ID but won't be store in the repository. this ID cannot be use for future use
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎14-06-2021 03:45 PM - edited ‎14-06-2021 03:47 PM
Hello
Thank you for the article.
Is it possible when updating or creating an object with a relationship. To search for example an object with the list not trough an id? for example:
list:[{name:"qwertz"}]
Instead of:
list:[{id:"39cXIxu2HHrI"}]
This would be useful for an interface, because it's not always possible for an external to know the ID of the object in MEGA.
Kind regards
Hendrik
