Ktor 3.0.1 PR <https://github.com/ExpediaGroup/gra...
# graphql-kotlin
started a new PR, old one looks stale and I'm currently blocked by this. two tests are still failing, seems like the mock is failing and I have no idea why
but I noticed that this is already on snapshot 9.0, should I target a different branch?
s
should be against master, and this would be a breaking change so a v9 will be needed
s
alright. I'll see if I can figure it out
attempted to test v9 but getting
ConflictingTypesException: Conflicting class names in schema generation [class com.example.TestError, class com.example.TestError]
Copy code
sealed interface Err {
    val message: String
}

data object TestError: Err {
    override val message: String = "Test error"
}

class TestQueries : Query {
    suspend fun test(): TestError = TestError
}
I don't understand how this can happen, as it is the same class/object even.
d
based on the error it looks like you have two
TestError
classes in
com.example
package
s
I know, but there is only this one shown above. removing the
message
property from the interface fixes it.
d
maybe there are other files that define it?
unsure
s
https://github.com/TheDome0/graphql-repros (it's built on the PR for ktor 3.0 though)
there really is no second NotFound class anywhere in source
there are also other situations like typical error unions (so error classes implementing multiple interfaces) where this happens but I haven't figured out an exact repro for that
I created a v8 branch with graphql version 8.2.1 where this does not happen
I tried adding a custom willgenerateGraphQLType hook but then I'm getting
You have redefined the type 'TestError' from being a 'GraphQLObjectType' to a 'GraphQLObjectType'
d
based on the error it implies you attempted to define two
TestError
objects in your schema -> check whether they are redefined twice in the same package (or packages) that is loaded by the test
s
that's exactly the issue, there is no second object. in the repo above it's
NotFound
it works with v8 but not with v9. I almost assume it's related to the kotlin bump because I can't find anything else
s
Created a new PR for Ktor 3.0.3 with all build checks passing. Please take a look when you can. https://github.com/ExpediaGroup/graphql-kotlin/pull/2066
Added another commit to remove the
InvalidPayloadException
class that was added in a previous commit and instead pass on the exception to Ktor's internal interceptor. More details in comment: https://github.com/ExpediaGroup/graphql-kotlin/pull/2066/commits/d2a73476c36148c7b62d5e81929349cdb54afb7d#r1899342509
a
Noticed the build for this failed when merging to main, also waiting for this, any clues when it will be released?
s
Seems the failure is caused because of using a deprecated action.
s
ahhh, ill take a look at this tomorrow morning
👍 1