I was looking at this RFC <https://github.com/grap...
# apollo-kotlin
s
I was looking at this RFC https://github.com/graphql/graphql-spec/pull/373 and I wonder, is this something that apollo-kotlin supports, or what is the status on this in general? I couldn’t find any more information on this, and the information I find online is conflicting due to some answers being older than that RFC
b
Yes, interfaces implementing interfaces currently works. Not 100% sure but I think it doesn't impact Apollo that much in the end 🙂
(since interfaces and types need to declare all the fields of the interfaces they implement)
but yeah it's currently part of the latest GraphQL spec at least
s
Thanks a ton for these links! In our case we had basically an interface, let’s call if
Flow
and then we had a bunch of types implementing it, like
TerminationDateFlow
,
TerminationLocationFlow
, and then others of another concept, like
ClaimDateFlow
,
ClaimLocationFlow
so I was looking if we can make a subtype of type
TerminationFlow
and
ClaimFlow
so that these other types can extend from instead so have a bit better story in how we handle these generated types. now:
Copy code
interface Flow

type TerminationDateFlow implements Flow { ... }
type TerminationLocationFlow implements Flow { ... }
type ClaimDateFlow implements Flow { ... }
type ClaimLocationFlow implements Flow { ... }
potential future:
Copy code
interface Flow

interface TerminationFlow implements Flow
interface ClaimFlow implements Flow

type TerminationDateFlow implements TerminationFlow { ... }
type TerminationLocationFlow implements TerminationFlow { ... }
type ClaimDateFlow implements ClaimFlow { ... }
type ClaimLocationFlow implements ClaimFlow { ... }
That’s pretty much it. So we get some generated code where we can use those types as
TerminationFlow
instead of
Flow
and have the potential mixup between the two. I’ll start looking into if we can just go ahead and do that then. The only limitation might be if what our backend uses (Netflix DGS) doesn’t support this, or if what we use for iOS also doesn’t support this. Thanks a lot again 🤗
b
that makes sense! Don't hesitate to tell us how that goes, it's an interesting topic 🙂 (I bet DGS and iOS support it, but not 100% sure!)
s
Yeah, will tell ya if we hit any roadblocks, gonna have to discuss with backend a bit 😄