Open sbegaudeau opened 1 year ago
For this issue, there are multiple tasks that need to be performed:
sirius-components-graphql
sirius-components-annotations-spring
IDataFetcherWithFieldCoordinates
After that, add a dependency to
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-graphql</artifactId> </dependency>
in the various graphql projects such as:
graphql
sirius-components-diagrams-graphql
sirius-components-forms-graphql
sirius-components-selection-graphql
sirius-web-graphql
And change all the data fetchers from this:
@MutationDataFetcher(type = "Mutation", field = MutationCreateProjectDataFetcher.CREATE_PROJECT_FIELD) public class MutationCreateProjectDataFetcher implements IDataFetcherWithFieldCoordinates<IPayload> { @Override public IPayload get(DataFetchingEnvironment environment) throws Exception { // ... } }
to this:
@Controller public class MutationCreateProjectDataFetcher { @MutationMapping public IPayload createProject(@Argument CreateProjectInput input) { // ... } }
Once this is done, you will also need to remove the dependency to subscription-transport-ws to use graphql-ws instead on the frontend.
subscription-transport-ws
graphql-ws
When everything is over and the code compiles, use the following configuration properties in the application{-dev}.properties of Sirius Web:
spring.graphql.path
/api/graphql
spring.graphql.websocket.path
/api/subscription
After that a release will be needed to let consumers of Sirius Components adapt to this sizable API change.
Have a look at the official Apollo documentation regarding the migration from subscription-transport-ws to graphql-ws here and the spring-graphql documentation there.
We will also be able to delete sirius-components-graphiql since GraphiQL is provided by spring-graphql with an up to date version.
sirius-components-graphiql
For this issue, there are multiple tasks that need to be performed:
sirius-components-graphql
sirius-components-annotations-spring
IDataFetcherWithFieldCoordinates
After that, add a dependency to
in the various
graphql
projects such as:sirius-components-diagrams-graphql
sirius-components-forms-graphql
sirius-components-selection-graphql
sirius-web-graphql
And change all the data fetchers from this:
to this:
Once this is done, you will also need to remove the dependency to
subscription-transport-ws
to usegraphql-ws
instead on the frontend.When everything is over and the code compiles, use the following configuration properties in the application{-dev}.properties of Sirius Web:
spring.graphql.path
for the path of the GraphQL API (something like/api/graphql
should do the trick for Sirius Web)spring.graphql.websocket.path
for the path of the subscriptions (I think that we are using/api/subscription
currently in Sirius Web)After that a release will be needed to let consumers of Sirius Components adapt to this sizable API change.