Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Sirius Web - how to get document IDs with GraphQL
Sirius Web - how to get document IDs with GraphQL [message #1860148] Wed, 19 July 2023 14:44 Go to next message
Oguzhan Balandi is currently offline Oguzhan BalandiFriend
Messages: 1
Registered: July 2023
Junior Member
Hi

With the following query I can get the project and representation IDs. But how do I get the document IDs?

query Viewer {
viewer {
projects {
edges {
node {
id
name
visibility
currentEditingContext {
id
representations {
edges {
node {
id
label
kind
}
}
}
}
}
}
}
}
}
Re: Sirius Web - how to get document IDs with GraphQL [message #1860172 is a reply to message #1860148] Thu, 20 July 2023 15:42 Go to previous message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 705
Registered: July 2009
Senior Member
Hi.

I don't think there is a GraphQL API for that.

The Sirius Web Sample Application's GraphQL Schema (https://github.com/eclipse-sirius/sirius-components/blob/master/packages/sirius-web/backend/sirius-web-graphql/src/main/resources/schema/siriusweb.graphqls) only exposes the API/end-points strictly needed by the application itself, and in that context listing documents (which is a notion specific to the sample application, and not part of the core framework) is never needed (they are only exposed as the root nodes in the Explorer view).

This is a design choice. Instead of trying to expose a generic GraphQL schema that would try to be "complete" for arbritrary manipulations of the various concepts, we only expose what it actually needed by the application.
On the other hand, the way this is implemented makes it easy for applications that have different needs to extend the GraphQL Schema with new concepts, queries or mutations.

If a different application needs this capability, it can add them by providing an additional '.graphqls' file which defines the new query and implementing the corresponding data fetcher in the backend (there are many example data fetchers to take inspiration from).

Regards,
Pierre-Charles


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Copying the Interpreter results?
Next Topic:Copy a Model with His representations in Obeo Designer Comunity
Goto Forum:
  


Current Time: Thu Oct 10 01:09:59 GMT 2024

Powered by FUDForum. Page generated in 0.56340 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top