Skip to content

relationships aren't marked as required #251

Closed
@glentakahashi

Description

@glentakahashi

given this code:

class Parent(db.Model):
    __tablename__ = "parent"
    id = db.Column(Integer, primary_key=True)

    children = db.relationship("Child", back_populates="parent")

class Child(db.Model):
    __tablename__ = "child"
    id = db.Column(Integer, primary_key=True)

    parent_id = db.Column(Integer, ForeignKey("parent.id"), nullable=False)
    parent = db.relationship("Parent", back_populates="children")

I would expect this to be generated:

type Parent {
  id: ID!
  children: [Child!]!
}
type Child {
  id: ID!
  parent: Parent!
}

However this is what gets generated:

type Parent {
  id: ID!
  children: [Child]
}
type Child {
  id: ID!
  parent: Parent
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions