Skip to content

Create nested Relationship #63

@dimas-cyriaco

Description

@dimas-cyriaco

Is it possible to created a relationship object in the same request that creates other object?

For example:

If I have an Entity Student with a OneToMany relationship with Grade, can i pass something like this to the POST /students endpoint and have it create both the Student and the Grade?

{
  "data": {
    "type": "student",
    "attributes": {
      "name": "John Doe",
    },
    "relationships": {
      "grades": {
        "data": [{
          "attributes": {
            "score": "A"
          }
        }]
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions