spring-graphql icon indicating copy to clipboard operation
spring-graphql copied to clipboard

Example to use Spring GraphQL with a federation library

Open ragavlatha opened this issue 3 years ago • 3 comments

Is there any example project with Spring GraphQL on how to configure the service inorder to be used with a federation library like Apollo ?

ragavlatha avatar May 09 '22 19:05 ragavlatha

@ragavlatha It's pretty straightforward. Have a look at my repository that I used few weeks ago to report an issue https://github.com/MariuszCwikla/spring-graphql-federation-union-issue

@Bean 
public GraphQlSourceBuilderCustomizer exposeFederation () {
return builder -> {
	builder.schemaFactory((registry, wiring)-> 
			Federation.transform(registry, wiring).build()
		);
       };
}

This repo does not present how to build federated supergraph but actually it's straighforward to do it with Apollo Router.

MariuszCwikla avatar May 12 '22 19:05 MariuszCwikla

We don't have an example, but would be good to have it, possibly at apollographql/federation-jvm.

rstoyanchev avatar May 13 '22 09:05 rstoyanchev

Hello 👋 I created an example integration under https://github.com/apollographql/federation-jvm-spring-example.

dariuszkuc avatar Jun 03 '22 18:06 dariuszkuc

https://github.com/apollographql/federation-jvm-spring-example link is broken @dariuszkuc

bishopmate avatar Mar 16 '23 17:03 bishopmate

@dariuszkuc a belated thanks for putting that together! @bishopmate the link does work for me. I'm going to turn this into a documentation task to refer to the above sample from our reference docs.

rstoyanchev avatar Apr 12 '23 11:04 rstoyanchev