Skip to content

One-Sided Relationship Support

Currently, if there is only reference in one direction, the tool produces an error saying that it cannot determine the kind of relationship.

type Hive {
    id: ID!
    bees: [Bee!]!
}

type Bee {
    id: ID!
}

In the example above, the many to one relationship between Bee and Hive may be assumed because a one Hive contains a list of Bees. Hence, a foreign key referencing Hive.id should be added to Bee model, and respective relationship with backref so the bees collection could be accessed on Hive instance.