CreateRepresentation API call fails with 'No handler found for event: CreateRepresentationInput' [message #1847367] |
Mon, 25 October 2021 12:26  |
Andre Seecamp Messages: 13 Registered: July 2021 |
Junior Member |
|
|
Hello everyone,
I am working on a service which should create a representation for an already created document in Sirius Web.
Currently I am testing the API provided by Sirius Web with a cURL Request.
I also already tried it with the graphiql interface but this lead to the same problem.
The cURL request looks like this:
curl \
-X POST \
-H "Content-Type: application/json" \
--data '{"query":" mutation createRepresentation ($input: CreateRepresentationInput!) { createRepresentation (input: $input) { __typename ... on ErrorPayload { message } } }","variables":{"input":{"id":"5eab377a-cfa0-4d3e-b6f6-38d5190e05cf","objectId":"5d99c844-a3b4-4723-932f-6285cd116275","editingContextId":"7f9f322f-8767-40ce-8bcf-4f3b44e9bcda","representationDescriptionId":"5eab377a-cfa0-4d3e-b6f6-38d5190e05cf","representationName":"TestRepresentation"}}}' \
http://localhost:8080/api/graphql
I inserted the current editingContextId and the objectId (which I assume correlates to the documentId?). The id and representationDescriptionId are set randomly.
Now, Sirius Web returns an error if I execute the query. In my console I receive the following error:
Quote:'No handler found for event: CreateRepresentationInput {id: 5eab377a-cfa0-4d3e-b6f6-38d5190e05cf, editingContextId: 7f9f322f-8767-40ce-8bcf-4f3b44e9bcda, representationDescriptionId: 5eab377a-cfa0-4d3e-b6f6-38d5190e05cf, objectId: 5d99c844-a3b4-4723-932f-6285cd116275, representationName: TestRepresentation}
I already took a look at the code which returns the error, but I can not figure out what I have to change to make the query work.
If anyone could point out what is wrong with my query I would be very grateful!
Thanks in advance!
Best regards,
André
|
|
|
Re: CreateRepresentation API call fails with 'No handler found for event: CreateRepresentationInput' [message #1847500 is a reply to message #1847367] |
Fri, 29 October 2021 07:55   |
|
Quote:
I inserted the current editingContextId and the objectId (which I assume correlates to the documentId?). The id and representationDescriptionId are set randomly.
- The "editingContextId" is not the documentId but the projectId (in most cases, you can assume editingContext == project).
- The "objectId" should be the id of the semantic element on which the new representation is to be created
- The plain "id" can be randomly chosen, it only serves as an identifier for the request itself
- The "representationDescriptionId" is *not* random, it should be the id of the type of representation you want to create, typically a DiagramDescription.
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Powered by
FUDForum. Page generated in 0.02206 seconds