Does anybody get `Query` as property type working?...
# graphql-kotlin
f
Does anybody get
Query
as property type working? For example this class:
Copy code
class MyMutation {
    fun do(): Payload
}

class Payload {
    lateinit val query: Query
}
Will not generate schema with error of
Cannot convert com.expediagroup.graphql.server.operations.Query since it is not a valid GraphQL type or outside the supported packages
Yet such schema structure is handy in mutations – when you want to query data right after some mutation resolver: https://graphql-rules.com/rules/mutation-payload-query
s
We had a discussion about this here: https://github.com/ExpediaGroup/graphql-kotlin/discussions/1169 But we decided that is was a pattern that actually shouldn’t be implemented: https://github.com/ExpediaGroup/graphql-kotlin/discussions/1169#discussioncomment-822669
Update on this, with the addition of
@GraphQLType
you can now just set the return type to a type reference and this works https://github.com/ExpediaGroup/graphql-kotlin/discussions/1169#discussioncomment-3882078
f
Cool, thank you!