You can now asynchronously fetch related data in one-line of code. For example: if a post has many comments, you can lazy load comments using the async toArray() function:await post.comments.toArray(). You can also lazy load hasOne relationships, for example: await post.author. DataStore also takes advantage of JavaScript’s built-in async iterator support to make it easier for you to author for loops:
for await (const comment of post.comments) {
console.log(comment) // iterates over each comment!
}
You can now query based on conditions of related models. For example, if you only want to get the comments of posts with a title starting with “Amplify”, you can now do the following:
await DataStore.query(Comment, c => c.post.title.beginsWith(“Amplify”)
Default exports removed from, e.g.import Auth from '@aws-amplify/auth' is no longer supported
@aws-amplify/analytics
@aws-amplify/api-rest
@aws-amplify/api-graphql
@aws-amplify/api
@aws-amplify/cache
@aws-amplify/datastore
@aws-amplify/geo
@aws-amplify/interactions
@aws-amplify/predictions
@aws-amplify/pub
@aws-amplify/storage
@aws-amplify/xr
aws-amplify
@aws-amplify/api, @aws-amplify/pubsub: Network subscriptions are automatically reconnected and observables stays available (previously observables were closed after network issues)
@aws-amplify/analytics: Analytics.record no longer accepts string as first param
aws-amplify
Amplify.Auth,Amplify.Cache, Amplify.ServiceWorker static members are no longer available on Amplify singleton #10562
Removed CSS modules export
@aws-amplify/pubsub: Removed misspelled type export MqttProvidertOptions from MqttOverWSProvider provider
@aws-amplify/core: Removed JS export from in favor of individual function exports #10528
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps @aws-amplify/core from 4.5.6 to 5.0.1.
Release notes
Sourced from
@aws-amplify/core
's releases.... (truncated)
Commits
cc45819
chore(release): Publish [ci skip]df02d36
chore: Release from main (#10661)734a079
chore: Add next tag to publish:release (#10660)d987a28
fix(datastore): upgrade after destructive schema change (#10658)d98bf4c
Revert "chore: bump version for user agent to 5.0.1" (#10657)6c2f4ba
chore: bump version for user agent to 5.0.1 (#10655)623374d
fix(storage): changed returned event.key value when using resumable:true to b...a517610
fix: export DataStore predicate types (#10653)2c64ac0
chore: V5 package changelog cleanup (#10650)af1963c
chore: Resume the conventional commit release process (#10642)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)