1.0.0-rc.6
🌟 Help us spread the word about Prisma-AppSync by starring the repo.
🚨 This release include breaking changes, so please make sure to read the below thoroughly before upgrading.
Breaking
💔 Updated upsert<Model>
mutation params to be similar to Prisma Client API
This change is considered breaking if you are using upsert
mutations.
# before
mutation {
upsertPost(
where: { id: 1 }
data: { title: "Hello world" }
) {
title
}
}
# after
mutation {
upsertPost(
where: { id: 1 }
create: { title: "Hello world" }
update: { title: "Hello world" }
) {
title
}
}
💔 Updated QueryParams.paths
format to fix various reported issues on Shield ACL rules
This change fixes various reported issues on Shield ACL rules. See full details here. It also allows creating more granular rules such as createPost/**/connect{,/**}
.
Only considered breaking if you have implemented advanced fine-grained access control rules, or if you are using QueryParams.paths
for some custom business logic (most likely inside Hooks).
Example:
mutation createPost {
createPost(
data: {
title: "Hello people"
author: { connect: { id: 1 } }
}
) {
id
title
}
}
Before:
{
"paths": [
"/create/post/title",
"/create/post/author/id",
"/get/post/id",
"/get/post/title"
]
}
After:
{
"paths": [
"createPost",
"createPost/title",
"createPost/author",
"createPost/author/connect",
"createPost/author/connect/id",
"getPost",
"getPost/id",
"getPost/title"
]
}
Highlights
⚡️ Support for custom GraphQL scalars on fields
Prisma schema:
/// @gql(scalars: { website: "AWSURL" })
model Company {
id Int @id @default(autoincrement())
name String
website String?
}
GraphQL output:
type Company {
id: Int!
name: String!
website: AWSURL
}
⚡️ Support for nullable in Query filters
Example #1:
query {
listUsers (
where: {
fullname: { isNull: true }
}
) {
id
}
}
Example #2:
query {
listPosts (
where: {
author: { is: NULL }
}
) {
id
}
}
Example #3:
query {
listPosts (
where: {
author: { isNot: NULL }
}
) {
id
}
}
⚡️ Refreshed documentation
Prisma-AppSync documentation has been refreshed with new navigation, revised content, and a new guide on Tweaking the GraphQL Schema.
Fixes and improvements
- The local dev server now supports concurrent queries.
- The local dev server now returns __typename (similar to AppSync)
- All fields with
@default()
are now optional in GraphQL output - Improved performances on ACL Shield Functions (checks now runs in parallel).
- Fixed issue with ACL Shield rules and WhereUniqueInput.
- Fixed issue with using
is
andisNot
insidesome
orevery
. - Fixed issue using arguments with no selectionSet on the local dev server.
- Fixed issue with
UpdateRelationsInput
,delete
anddeleteMany
input types.
Sponsors
Solve and sparkle up your daily food life | Collaborative travel planning |
Credits
Sylvain 🐙 💻 🤔 📖 | Bell 💻 🤔 | Tom 💻 🤔 | jeremy-white 💻 |
Annoucements
I am starting my Founder journey with kuizto.co. Kuizto is a bit like Netflix for your daily food! Lots of visual cooking inspiration, auto-generated grocery lists, and a small social layer to share and discover deliciously simple meals. Please register for early access, launching later this year!
Prisma-EdgeQL is an edge-compatible Prisma Client (using PlanetScale driver). The project was initially built as part of my work at kuizto.co and will be released open-source soon. Please go Star the repo if you are interested!
Github sponsors
Enjoy using Prisma-AppSync? Please consider 💛 Github sponsors.