github amplication/amplication v0.11.4
0.11.4

latest releases: v1.16.4, v1.16.3, v1.16.2...
2 years ago

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
  }
}
Issue Description
Now GraphQL API allows the creation of data with many-to-many relationships.
Fixed the generated app so it uses the correct data type for many-to-many relationships on the REST API controller.
The decorator gqlUserRoles.decorator.ts now checks for the existence of the user on the request and fails when there is no user in context.
Started using multi-line comments for a clear and readable generated code message.
Added the ability to filter an entity by relation.
Added support for creation of many-to-many relationships.

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 ⚠️

Issue Description
Upgraded the node-fetch version from 2.6.6 to 2.6.7.
Upgraded the node_modules/node-fetch version from 2.6.6 to 2.6.7.
Upgraded the ra-data-graphql-amplication version from 0.0.6 to 0.0.8.

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!

Don't miss a new amplication release

NewReleases is sending notifications on new releases.