You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/fragments/lib-v1/datastore/ios/sync/50-selectiveSync.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,9 +27,9 @@ Developers should only specify a single `syncExpression` per model. Any subseque
27
27
28
28
</Callout>
29
29
30
-
### Reevaluate expressions at runtime
30
+
### Re-evaluate expressions at runtime
31
31
Sync expressions get evaluated whenever DataStore starts.
32
-
In order to have your expressions reevaluated, you can execute `Amplify.DataStore.clear()` or `Amplify.DataStore.stop()` followed by `Amplify.DataStore.start()`.
32
+
In order to have your expressions re-evaluated, you can execute `Amplify.DataStore.clear()` or `Amplify.DataStore.stop()` followed by `Amplify.DataStore.start()`.
33
33
34
34
If you have the following expression and you want to change the filter that gets applied at runtime, you can do the following:
35
35
@@ -64,7 +64,7 @@ func changeSync() {
64
64
}
65
65
}
66
66
```
67
-
Each time DataStore starts (via `start` or any other operation: `query`, `save`, `delete`, or `observe`), DataStore will reevaluate the `syncExpressions`.
67
+
Each time DataStore starts (via `start` or any other operation: `query`, `save`, `delete`, or `observe`), DataStore will re-evaluate the `syncExpressions`.
68
68
69
69
In the above case, the predicate will contain the value `1`, so all Posts with `rating > 1` will get synced down.
70
70
@@ -96,7 +96,7 @@ func changeSync() {
96
96
}
97
97
```
98
98
99
-
This will clear the contents of your local store, reevaluate your sync expressions and re-sync the data from the cloud, applying all of the specified predicates to the sync queries.
99
+
This will clear the contents of your local store, re-evaluate your sync expressions and re-sync the data from the cloud, applying all of the specified predicates to the sync queries.
100
100
101
101
You can also have your sync expression return `QueryPredicateConstant.all` in order to remove any filtering for that model. This will have the same effect as the default sync behavior.
Copy file name to clipboardExpand all lines: src/fragments/lib-v1/datastore/native_common/setup-env-cli.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ amplify add api
13
13
amplify update api
14
14
```
15
15
16
-
The CLI will prompt you to configure your API. Select **GraphQL** as the API type and reply to the questions as shown below. Conflict detection is **required** when using the DataStore to sync data with the cloud.
16
+
The CLI will prompt you to configure your API. Select **GraphQL** as the API type and reply to the questions as shown below. Conflict detection is **required** when using DataStore to sync data with the cloud.
17
17
18
18
```console
19
19
? Please select from one of the below mentioned services:
Copy file name to clipboardExpand all lines: src/fragments/lib-v1/datastore/native_common/sync.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,13 @@ Once you're happy with your application, you can start syncing with the cloud by
9
9
10
10
## Setup cloud sync
11
11
12
-
Synchronization between offline and online data can be tricky. DataStore goal is to remove that burden from the application code and handle all data consistency and reconciliation between local and remote behind the scenes, while developers focus on their application logic. Up to this point the focus was to setup a local datastore that works offline and has all the capabilities you would expect from a data persistence framework.
12
+
Synchronization between offline and online data can be tricky. DataStore's goal is to remove that burden from the application code and handle all data consistency and reconciliation between local and remote behind the scenes, while developers focus on their application logic. Up to this point the focus was to setup a local data store that works offline and has all the capabilities you would expect from a data persistence framework.
13
13
14
-
The next step is to make sure the local saved data is synchronized with a cloud backend powered by [AWS AppSync](https://aws.amazon.com/appsync/).
14
+
The next step is to make sure the locally saved data is synchronized with a cloud backend powered by [AWS AppSync](https://aws.amazon.com/appsync/).
15
15
16
16
<Callout>
17
17
18
-
**Note:** Syncing data between the cloud and the local device starts automatically whenever you run any DataStore operation after your app is setup.
18
+
**Note:** Syncing data between the cloud and the local device starts automatically whenever you run any DataStore operation after your app is set up.
Here we've first created a new `Post` instance and a new `User` instance. Then, saved those instances to a new instance of our join model `PostEditor`.
@@ -26,23 +26,23 @@ Here we've first created a new `Post` instance and a new `User` instance. Then,
26
26
To query many-to-many relationships, use a nested predicate to filter the target model by the source model's id:
Copy file name to clipboardExpand all lines: src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ async function changeSync() {
51
51
rating =1;
52
52
awaitDataStore.stop();
53
53
awaitDataStore.start();
54
-
}
54
+
};
55
55
```
56
56
57
57
Upon calling `DataStore.start()` (or executing a DataStore operation, e.g., `query`, `save`, `delete`, or `observe`), DataStore will reevaluate the `syncExpressions`.
@@ -71,7 +71,7 @@ async function changeSync() {
71
71
rating =8;
72
72
awaitDataStore.clear();
73
73
awaitDataStore.start();
74
-
}
74
+
};
75
75
```
76
76
This will clear the contents of your local store, reevaluate your sync expressions and re-sync the data from the cloud, applying all of the specified predicates to the sync queries.
Copy file name to clipboardExpand all lines: src/fragments/lib/datastore/native_common/setup-auth-rules.mdx
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ import datastoreClearCallout from '/src/fragments/lib/datastore/native_common/ca
18
18
19
19
### Per User / Owner Based Data Access
20
20
21
-
The following are commonly used patterns for owner based authorization. For more information on how to tune these examples, please see the [CLI documentation on owner based authorization](/cli/graphql/authorization-rules/#per-user--owner-based-data-access).
21
+
The following are commonly used patterns for owner based authorization. For more information on how to fine tune these examples, please see the [CLI documentation on owner based authorization](/cli/graphql/authorization-rules/#per-user--owner-based-data-access).
22
22
23
23
- Create/Read/Update/Delete mutations are private to the owner.
- Users have their own data, but users who belong to the `Admin` group have access to their data and anyone else in that group. Users in the `Admin` group have the ability to make mutation on behalf of users not in the `Admin` group
79
79
@@ -87,7 +87,7 @@ type YourModel
87
87
88
88
### Public Data Access
89
89
90
-
The following are commonly used patterns to grant everyone access. For more information on how to tune these examples, please see the [CLI documentation on public data access](/cli/graphql/authorization-rules/#public-data-access).
90
+
The following are commonly used patterns to grant everyone access. For more information on how to fine tune these examples, please see the [CLI documentation on public data access](/cli/graphql/authorization-rules/#public-data-access).
91
91
92
92
- Auth provider is API Key
93
93
@@ -107,7 +107,7 @@ type YourModel @model @auth(rules: [{ allow: public, provider: iam }]) {
- Using a 3rd party OIDC provider to achieve owner based authorization.
133
133
@@ -153,7 +153,7 @@ import flutterOidc from '/src/fragments/lib/datastore/flutter/setup-auth-rules/o
153
153
154
154
### Static Group Authorization with OIDC provider
155
155
156
-
The following are commonly used patterns for using `groupClaims` to achieve group based authorization using a 3rd party OIDC provider. For more information on how to tune these examples, please see the [CLI documentation on static group authorization](/cli/graphql/authorization-rules#custom-claims).
156
+
The following are commonly used patterns for using `groupClaims` to achieve group based authorization using a 3rd party OIDC provider. For more information on how to fine tune these examples, please see the [CLI documentation on static group authorization](/cli/graphql/authorization-rules#custom-claims).
157
157
158
158
- Using a custom value for `groupClaim` to achieve static group authorization with a 3rd party OIDC provider.
0 commit comments