I have a UserType and a userable that can be a Writer or Account.
For GraphQL I figured maybe I could use a UserableUnion like this:
UserableUnion = GraphQL::UnionType.define do name "Userable" description "Account or Writer object" possible_types [WriterType, AccountType] end and then define my UserType like this:
UserType = GraphQL::ObjectType.define do name "User" description "A user object" field :id, !types.ID field :userable, UserableUnion end But I get schema contains Interfaces or Unions, so you must define a 'resolve_type (obj, ctx) -> { ... }' function
I have tried putting a resolve_type in multiple places, but I can't seem to figure this out?
Does any one now how to implement this?