Open b4eEX opened 6 years ago
Hi. Is there any progress with this issue? Thanks.
@b4eEX Is this issue still relevant now with the new @connection
directive?
I guess it still should, but I didn’t even manage to make a “standalone” connection type to use in a union.
Something like this:
type XConnection @connection(for: “X”) {}
type YConnection @connection(for: “Y”) {}
union AnyConnection = XConnection | YConnection
XConnection
and YConnection
don’t seem to get generated, so I can’t even get to union resolution phase.
On 24 Nov 2018, at 10:48, Michiel Oliemans notifications@github.com wrote:
@b4eEX https://github.com/b4eEX Is this issue still relevant now with the new @connection directive?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/graphql-java-kickstart/graphql-java-tools/issues/186#issuecomment-441355817, or mute the thread https://github.com/notifications/unsubscribe-auth/AmI6gZXQYoxYgV4O9TNTQ84UT6bgom9sks5uyRXrgaJpZM4XDptq.
@b4eEX The @connection
directive only works for fields, not for types. I'll leave this issue open then to take a look at when I have some more time.
@b4eEX The
@connection
directive only works for fields, not for types. I'll leave this issue open then to take a look at when I have some more time.
@oliemansm what do you mean? Your documentation actually showcases that: https://www.graphql-java-kickstart.com/tools/relay/#using-the-type-definition-factory
@b4eEX The
@connection
directive only works for fields, not for types. I'll leave this issue open then to take a look at when I have some more time.@oliemansm what do you mean? Your documentation actually showcases that: https://www.graphql-java-kickstart.com/tools/relay/#using-the-type-definition-factory
The @connection
directive must be on a field (usually within the Query
root object). In your example it is on a type definition which is not supported.
The issue is relevant for 5.3.1+.
I'm trying to create an interface with a polymorphic connection field, which requires interface to declare it as a union of all implementation types, something like
However, trying to do something like this fails on
com.coxautodev.graphql.tools.TypeResolverError: Expected object type with name 'DefaultConnection' to exist for union 'AnyConnection', but it doesn't!
.My reproducer, based on relay connection test:
The culprit appears to be https://github.com/graphql-java-kickstart/graphql-java-tools/blob/24b42b0ba048bc148754946c8b5c31f25a6b0be8/src/main/kotlin/com/coxautodev/graphql/tools/DictionaryTypeResolver.kt#L26
It seems to try to do all the autowiring magic, but Connection types have class names that are different from GraphQL types. Adding dictionaries won't help also, since they're all
DefaultConnection
.