Skip to content
Our sponsors
Kuizto — The Everyday Cooking App

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

Credits

Sylvain
Sylvain

🧙‍♂️ 💻 🤔 📖
Ciprian Caba
Ciprian Caba

💻 🤔
Bell
Bell

💻

Github sponsors

Enjoy using Prisma-AppSync? Please consider 💛 Github sponsors.

Released under the BSD 2-Clause License.