We are happy to announce the patch release of Amplication 0.11.4
🥳
Help us spread the word about Amplication by starring 🌟 the repo or tweeting 🐦 about the release. 🚀
In this release, we have improved the generated app by including new enhancements, such as many-to-many relationships and filtering an entity list by relation. In addition, we have upgraded the core libraries and done some fixes.💜
Generated App 📱
Connect and disconnect records with a many-to-many relationships
In previous versions, there was no way to link entities that used a many-to-many relationships. Now you can connect and disconnect related entities with many-to-many relationships.
Add connected records
The following example creates a new post and connect
three tag records to it.
Any previously linked record will remain linked to the post, even if it was not specified in the connect
property
mutation{
createPost(
data:{
title:"Intro to GraphQL API"
tags:{
connect:[
{id:"ckza5hdoh026201s6xdov9997"}
{id:"ckz9sbil5019501s6piaydpgv"}
{id:"ckza5hmvm033601s6c3ns25cs"}
]
}
}
){
id
title
tags{
id
name
}
}
}
Remove connected records
The following example updates a post and disconnect
a couple of tags from the post.
Any existing related entity that was not specified in the disconnect
property will remain linked to the post.
mutation{
updatePost(
where:{
id:"ckzi8urcd119501s6nbx8au6y"
}
data:{
tags:{
disconnect:[
{id:"ckz9sbil5019501s6piaydpgv"}
{id:"ckza5hmvm033601s6c3ns25cs"}
]
}
}
){
id
title
tags{
id
name
}
}
}
Set the list of connected records
The following example updates a post and set
the list of connected tags.
Any previously linked record that was not specified in the set
property will be removed.
mutation{
updatePost(
data:{
tags:{
set:[
{id:"ckza5hdoh026201s6xdov9997"}
{id:"ckz9sbil5019501s6piaydpgv"}
]
}
}
){
id
title
tags{
id
name
}
}
}
Filter an entity by a related record
Added the ability to filter an entity by values on a related record.
The following example returns all posts that are connected to a tag with a name equal to "open-source".
query{
posts(
where:{
tags:{
some:{
name:{
equals:"open-source"
}
}
}
}
)
{
id
title
}
}
Amplication Client 👨💻
Issue | Description |
---|---|
Fixed the bug where the tooltip text is not visible in light theme mode. | |
Now, on clicking the profile button, the user is taken to a profile page. |
Dependencies ⚠️
The complete list of all issues resolved in this release can be found on the 0.11.4 milestone on Github
Credits 👏
For this release, we had the help of many contributors – thank you all very much!