6.5.1 • Published 7 months ago

@mercurialweb/nexus-plugin-prisma v6.5.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

*Latest version of Prisma supported: 6.5.0

Note: Since the Prisma team is no longer keeping this library up to date with new Prisma versions, we have forked it.

This plugin integrates Prisma into Nexus. It gives you an API you to project fields from models defined in your Prisma schema into your GraphQL API. It also gives you an API to build GraphQL root fields that allow your API clients to query and mutate data.

You can find the documentation on the Nexus website.

New Features

Automatic Filtering for Relations

By default, all relational fields now include a where parameter allowing you to filter related records, if the underlying Prisma model supports filtering. This makes it easy to query only specific related items without additional configuration.

For example, with a User model related to Posts:

// User type with related Posts
objectType({
  name: 'User',
  definition(t) {
    t.model.id()
    t.model.name()
    t.model.posts() // automatically includes where parameter for filtering
  },
})

This allows GraphQL queries like:

{
  user(id: 1) {
    posts(where: { title: { contains: "Nexus" } }) {
      id
      title
    }
  }
}

You can disable this behavior by explicitly setting filtering: false when defining the field:

t.model.posts({ filtering: false })

Note: If a relation doesn't have filtering capabilities in the generated Prisma client, the filtering parameter will be silently omitted rather than causing an error.

Installation

npm install @mercurialweb/nexus-plugin-prisma
# OR
yarn add @mercurialweb/nexus-plugin-prisma
6.2.1

10 months ago

6.5.0

7 months ago

6.5.0-beta

7 months ago

6.5.1

7 months ago

6.5.0-beta.2

7 months ago

5.16.2

1 year ago

5.13.0

2 years ago

5.9.0-rc.1

2 years ago

5.9.1

2 years ago

5.7.2

2 years ago

5.7.1

2 years ago

5.6.0

2 years ago

5.4.2

2 years ago

5.4.1

2 years ago

5.3.1

2 years ago

5.2.0

2 years ago

5.1.1

2 years ago

5.0.0

2 years ago

4.16.2

2 years ago

5.5.2

2 years ago

4.16.1

2 years ago

0.49.2

2 years ago

0.49.1

3 years ago

0.40.8

3 years ago

0.49.0

3 years ago

0.40.6

3 years ago

0.40.7

3 years ago

0.40.4

3 years ago

0.40.5

3 years ago

0.40.2

3 years ago

0.40.3

3 years ago

0.40.1

3 years ago

0.40.0

3 years ago