-
Notifications
You must be signed in to change notification settings - Fork 106
Closed
Labels
Description
Hello,
I was wondering is there a way to create a resource and its relation in a single request. For example: I want to create a post with comments in single request:
{
"data": {
"type": "post",
"attributes": {
"title": "<post title>",
"description": "<post text>"
},
"relationships": {
"comments": {
"data": [
{
"type": "comments",
"attributes": {
"text" : "First comment"
}
},
{
"type": "comments",
"attributes": {
"text" : "Second comment"
}
}
]
}
}
}
}
The idea is not to assign post
to a comment
but create them. Is this valid approach at all if so how I can achieve using this package?
Thanks.
RobyCigar