Hello! I am having a small issue with `checkServic...
# apollo-kotlin
e
Hello! I am having a small issue with
checkServiceApolloDuplicates
. I am getting this build error:
Copy code
> duplicate Type 'ResolverKey(kind=OperationVariablesAdapter, id=CancelAgentTransactionMutation)' generated in modules: agent,field
  Use 'alwaysGenerateTypesMatching' in a parent module to generate the type only once
In the parent module I already added
apollo { alwaysGenerateTypesMatching.set(setOf("CancelAgentTransactionMutation", "other types here")) }
, but the error is still there 😄 Any ideas what might be going on?
Just to clarify, I was getting similar errors for other types as well, which after adding to
alwaysGenerateTypesMatching
disappeared, but this one for
CancelAgentTransactionMutation
doesn't want to go away 😄
b
hmmm this reminds me of a similar issue in the past where cleaning the build resolved it 😅 Have you already tried that by any chance?
e
This also happens on clean builds on the CI :)
b
all right it was worth trying 🙂
let me see if I can repro on a basic multi module project
apparently not 😅 . Do you have any queries/mutations/subscriptions in your schema module?
e
I'll try to come up with a small repro project tomorrow. Thanks for looking into it meanwhile :)
b
Repro project would definitely help 🙏
Hey could it be that you have the mutation
CancelAgentTransactionMutation
defined in several modules? 🤔 (thanks @mbonnin for the idea! 🙂)
e
ah, it seems like that is the case 😄 should I rename one of them? (they have different queries, I can't just pull one of them in the parent module), or is there any other solution? 😄
b
yeah having different names is certainly the best thing to do
m
Yea, we have a requirements that names are unique and a nice check for this but the check is only for a single module
We should make that error message a bit better
In theory, we could allow same operation name with different packages in different modules but that's not a great idea for observability. I.e. someone logging the operations in your backend will most likely be confused
e
yeah, I can see that happening in general. for us in particular,
field
and
agent
are separate apps, which include their own client name headers in the requests, so differentiating is easy 🙂
just to confirm, renaming fixed the issue. thanks again for your help!
m
Do you mind trying with the
3.6.1-SNAPSHOT
? If everything looks good, we'll make a patch release
e
yeah, it's all good with the snapshot version 🙂
m
Thanks for confirming, launching the build
It's rolling out to maven central, it should typically be live in ~20min
e
thanks for such a short turnaround time! ❤️
m
Sure thing! We ended up branching for the release (cause we have a bunch of things in flux in main at the moment) but it should have the fix from the SNAPSHOTs, let us know otherwise!