@@ -70,7 +70,7 @@ const schema = a.schema({
70
70
// from the `Member`s model.
71
71
members: a .hasMany (' Member' , ' teamId' ),
72
72
}),
73
- }).authorization (allow => [ allow .publicApiKey ()] );
73
+ }).authorization (( allow ) => allow .publicApiKey ());
74
74
```
75
75
76
76
### Create a "Has Many" relationship between records
@@ -462,7 +462,7 @@ const schema = a.schema({
462
462
// from the Cart model
463
463
activeCart: a .hasOne (' Cart' , ' customerId' )
464
464
}),
465
- }).authorization (allow => [ allow .publicApiKey ()] );
465
+ }).authorization (( allow ) => allow .publicApiKey ());
466
466
```
467
467
468
468
### Create a "Has One" relationship between records
@@ -830,7 +830,7 @@ const schema = a.schema({
830
830
// highlight-next-line
831
831
posts: a .hasMany (' PostTag' , ' tagId' ),
832
832
}),
833
- }).authorization (allow => [ allow .publicApiKey ()] );
833
+ }).authorization (( allow ) => allow .publicApiKey ());
834
834
```
835
835
836
836
## Model multiple relationships between two models
@@ -856,7 +856,7 @@ const schema = a.schema({
856
856
authoredPosts: a .hasMany (' Post' , ' authorId' ),
857
857
// highlight-end
858
858
}),
859
- }).authorization (allow => [ allow .publicApiKey ()] );
859
+ }).authorization (( allow ) => allow .publicApiKey ());
860
860
```
861
861
862
862
On the client-side, you can fetch the related data with the following code:
@@ -919,7 +919,7 @@ const schema = a.schema({
919
919
authoredPosts: a .hasMany (' Post' , [' authorName' , ' authorDoB' ]),
920
920
// highlight-next-line
921
921
}).identifier ([' name' , ' dateOfBirth' ]),
922
- }).authorization (allow => [ allow .publicApiKey ()] );
922
+ }).authorization (( allow ) => allow .publicApiKey ());
923
923
```
924
924
925
925
## Make relationships required or optional
@@ -949,5 +949,5 @@ const schema = a.schema({
949
949
authoredPosts: a .hasMany (' Post' , ' authorId' ),
950
950
// highlight-end
951
951
}),
952
- }).authorization (allow => [ allow .publicApiKey ()] );
952
+ }).authorization (( allow ) => allow .publicApiKey ());
953
953
```
0 commit comments