@@ -70,7 +70,7 @@ const schema = a.schema({
7070 // from the `Member`s model.
7171 members: a .hasMany (' Member' , ' teamId' ),
7272 }),
73- }).authorization (allow => [ allow .publicApiKey ()] );
73+ }).authorization (( allow ) => allow .publicApiKey ());
7474```
7575
7676### Create a "Has Many" relationship between records
@@ -462,7 +462,7 @@ const schema = a.schema({
462462 // from the Cart model
463463 activeCart: a .hasOne (' Cart' , ' customerId' )
464464 }),
465- }).authorization (allow => [ allow .publicApiKey ()] );
465+ }).authorization (( allow ) => allow .publicApiKey ());
466466```
467467
468468### Create a "Has One" relationship between records
@@ -830,7 +830,7 @@ const schema = a.schema({
830830 // highlight-next-line
831831 posts: a .hasMany (' PostTag' , ' tagId' ),
832832 }),
833- }).authorization (allow => [ allow .publicApiKey ()] );
833+ }).authorization (( allow ) => allow .publicApiKey ());
834834```
835835
836836## Model multiple relationships between two models
@@ -856,7 +856,7 @@ const schema = a.schema({
856856 authoredPosts: a .hasMany (' Post' , ' authorId' ),
857857 // highlight-end
858858 }),
859- }).authorization (allow => [ allow .publicApiKey ()] );
859+ }).authorization (( allow ) => allow .publicApiKey ());
860860```
861861
862862On the client-side, you can fetch the related data with the following code:
@@ -919,7 +919,7 @@ const schema = a.schema({
919919 authoredPosts: a .hasMany (' Post' , [' authorName' , ' authorDoB' ]),
920920 // highlight-next-line
921921 }).identifier ([' name' , ' dateOfBirth' ]),
922- }).authorization (allow => [ allow .publicApiKey ()] );
922+ }).authorization (( allow ) => allow .publicApiKey ());
923923```
924924
925925## Make relationships required or optional
@@ -949,5 +949,5 @@ const schema = a.schema({
949949 authoredPosts: a .hasMany (' Post' , ' authorId' ),
950950 // highlight-end
951951 }),
952- }).authorization (allow => [ allow .publicApiKey ()] );
952+ }).authorization (( allow ) => allow .publicApiKey ());
953953```
0 commit comments