graphql-spqr-spring-boot-starter
graphql-spqr-spring-boot-starter copied to clipboard
Throw exception on type clash
I just created two @Service
s with clashing method names:
@Service
@GraphQLApi
public class MyService1 {
@GraphQLMutation
public String foo() {
return "1";
}
}
@Service
@GraphQLApi
public class MyService2 {
@GraphQLMutation
public String foo() {
return "2";
}
}
Now it's completely random (changes every time I restart the application) which of those 2 methods gets called.
I think it would be best, if the auto configuration throws an exception, when adding a GraphQL Type that already exists.
Hi, I'll start working on updating the starter to work with 0.9.8 since it's out now. I'll look at this issue while I do that and keep you up to date.
I discussed this with @kaqqao and this should be prevented by underlying SPQR itself in some future version. What I can do is add a stopgap measure in the starter and as you said throw an exception. 0.0.2 should come around this weekend with extended support for SPQR 0.9.8 features, so this check will probably come in 0.0.3