-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: reuse effect on parent materializer + exclude non selected fields
- Loading branch information
1 parent
d387d0e
commit 60149e2
Showing
6 changed files
with
113 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -226,7 +226,7 @@ Meta.test("Policies for effects", async (t) => { | |
secrets: await genSecretKey(config), | ||
}); | ||
|
||
await t.should("succeeed", async () => { | ||
await t.should("succeed", async () => { | ||
await gql` | ||
query { | ||
findUser(id: 12) { | ||
|
@@ -250,6 +250,7 @@ Meta.test("Policies for effects", async (t) => { | |
updateUser(id: 12, set: { email: "[email protected]" }) { | ||
id | ||
password_hash # deny if role!=admin (here undefined) on effect update | ||
} | ||
} | ||
` | ||
|
@@ -261,7 +262,7 @@ Meta.test("Policies for effects", async (t) => { | |
findUser(id: 12) { | ||
id | ||
password_hash | ||
password_hash # deny on effect read | ||
} | ||
} | ||
` | ||
|
@@ -286,17 +287,5 @@ Meta.test("Policies for effects", async (t) => { | |
}) | ||
.withContext({ role: "admin" }) | ||
.on(e); | ||
|
||
await gql` | ||
query { | ||
findUser(id: 12) { | ||
id | ||
password_hash | ||
} | ||
} | ||
` | ||
.expectErrorContains("Authorization failed") | ||
.on(e); | ||
}); | ||
}); |