1.0.0-rc.5
🌟 Help us spread the word about Prisma-AppSync by starring the repo.
Highlights
⚡️ Async shield rules
Async Shield rules are now supported in Prisma-AppSync, opening up to 3 different ways to define fine-grained access control rules:
ts
return await prismaAppSync.resolve({
event,
shield: () => {
return {
// Boolean
'listPosts{,/**}': { rule: true },
// Function
'listPosts{,/**}': { rule: () => true },
// (NEW) Async Function
'listPosts{,/**}': {
rule: async () => {
await sleep(1000)
return true
},
},
}
},
})
⚡️ Support for deeply nested relation filters
Deeply nested relation filters are now supported in Prisma-AppSync, allowing to perform the following queries:
graphql
query {
listComments(
where: {
author: {
# deeply nested relation filter
posts: {
every: {
published: { equals: true }
}
}
}
}
)
}
graphql
query {
listUsers(
where: {
posts: {
every: {
# deeply nested relation filter
comments: {
every: {
message: { startsWith: 'hello' }
}
}
}
}
}
)
}
⚡️ Support for extendedWhereUnique
preview feature
Using the extendedWhereUnique
preview feature flag will enable filtering on non-unique fields in Prisma-AppSync, allowing to do the following:
prisma
generator client {
provider = "prisma-client-js"
previewFeatures = ["extendedWhereUnique"]
}
graphql
mutation($id: Int!, $version: Int) {
updatePost(
# version is a non-unique field
where: { id: $id, version: { equals: $version } },
operation: { version: { increment: 1 } }
) {
id
version
}
}
See Prisma Docs for more details.
Fixes and improvements
maxDepth
parameter not working properly with Json fields (Issue #71).- Local dev server reads
undefined
when using nested arrays in query (Issue #83). - GraphQL input
<Model>WhereUniqueInput
shouldn’t include Relation fields (Issue #83). - Unit tests for Prisma to GraphQL schema conversion (Issue #84).
- Local dev server returning
null
for0
values (PR #82). - Issue: fields with
@default
should appear as required!
in generated GraphQL schema base type (Issue #91). - Improved, more readable, Prisma Client errors logs.
Credits
Sylvain 🧙♂️ 💻 🤔 📖 | Ciprian Caba 💻 🤔 | Bell 💻 |
Github sponsors
Enjoy using Prisma-AppSync? Please consider 💛 Github sponsors.