
Prisma Client Api Query Options
- 14 installs
- 8 repo stars
- Updated February 9, 2026
- prisma/cursor-plugin
prisma-client-api-query-options documents select, include, and pagination options.
About
The prisma-client-api-query-options skill explains query shape controls beyond bare where filters. select picks scalar fields and nested relation projections including _count. include loads relations with filtered, ordered, and limited nested shapes. omit excludes sensitive fields and cannot combine with select. orderBy sorts single or multiple fields, relation counts, and nulls first or last. take and skip implement offset pagination while cursor enables stable keyset pages with skip one after cursor id. distinct returns unique combinations of fields. Cross-links filters.md for where details. Examples show password exclusion via omit and nested comment author graphs. select and include shape returned field graphs. omit excludes fields without pairing select. orderBy supports relation _count sorting. take, skip, and cursor cover pagination patterns. distinct returns unique field combinations. Queries returning only needed fields with correct pagination.
- select and include shape returned field graphs.
- omit excludes fields without pairing select.
- orderBy supports relation _count sorting.
- take, skip, and cursor cover pagination patterns.
- distinct returns unique field combinations.
Prisma Client Api Query Options by the numbers
- 14 all-time installs (skills.sh)
- Ranked #604 of 911 Databases skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
prisma-client-api-query-options capabilities & compatibility
- Capabilities
- select versus omit rules · cursor pagination walkthrough · filtered include examples
- Use cases
- database · api development
What prisma-client-api-query-options says it does
Cursor-based pagination
npx skills add https://github.com/prisma/cursor-plugin --skill prisma-client-api-query-optionsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 14 |
|---|---|
| repo stars | ★ 8 |
| Last updated | February 9, 2026 |
| Repository | prisma/cursor-plugin ↗ |
How do I paginate and shape Prisma query results?
Control Prisma queries with select, include, omit, orderBy, pagination, cursor, and distinct options.
Who is it for?
API developers reducing over-fetching in Prisma queries.
Skip if: Skip for trivial single-record fetches.
When should I use this skill?
User configures select, include, orderBy, or cursor pagination.
What you get
Queries returning only needed fields with correct pagination.
Files
Query Options
Options for controlling query behavior.
select
Choose specific fields to return:
const user = await prisma.user.findUnique({
where: { id: 1 },
select: {
id: true,
name: true,
email: true,
// password: false (excluded by not including)
}
})
// Returns: { id: 1, name: 'Alice', email: 'alice@prisma.io' }Select relations
const user = await prisma.user.findUnique({
where: { id: 1 },
select: {
name: true,
posts: {
select: {
title: true,
published: true
}
}
}
})Select with include inside
const user = await prisma.user.findMany({
select: {
name: true,
posts: {
include: {
comments: true
}
}
}
})Select relation count
const users = await prisma.user.findMany({
select: {
name: true,
_count: {
select: { posts: true }
}
}
})
// Returns: { name: 'Alice', _count: { posts: 5 } }include
Include related records:
const user = await prisma.user.findUnique({
where: { id: 1 },
include: {
posts: true,
profile: true
}
})Filtered include
const user = await prisma.user.findUnique({
where: { id: 1 },
include: {
posts: {
where: { published: true },
orderBy: { createdAt: 'desc' },
take: 5
}
}
})Nested include
const user = await prisma.user.findUnique({
where: { id: 1 },
include: {
posts: {
include: {
comments: {
include: {
author: true
}
}
}
}
}
})Include relation count
const users = await prisma.user.findMany({
include: {
_count: {
select: { posts: true, followers: true }
}
}
})omit
Exclude specific fields:
const user = await prisma.user.findUnique({
where: { id: 1 },
omit: {
password: true
}
})
// Returns all fields except passwordOmit in relations
const users = await prisma.user.findMany({
omit: { password: true },
include: {
posts: {
omit: { content: true }
}
}
})Note: Cannot use select and omit together.
where
Filter records:
const users = await prisma.user.findMany({
where: {
email: { contains: '@prisma.io' },
role: 'ADMIN'
}
})See filters.md for detailed filter operators.
orderBy
Sort results:
// Single field
const users = await prisma.user.findMany({
orderBy: { name: 'asc' }
})
// Multiple fields
const users = await prisma.user.findMany({
orderBy: [
{ role: 'desc' },
{ name: 'asc' }
]
})Order by relation
const users = await prisma.user.findMany({
orderBy: {
posts: { _count: 'desc' }
}
})Null handling
const users = await prisma.user.findMany({
orderBy: {
name: { sort: 'asc', nulls: 'last' }
}
})take & skip
Pagination:
// First page
const users = await prisma.user.findMany({
take: 10,
skip: 0
})
// Second page
const users = await prisma.user.findMany({
take: 10,
skip: 10
})Negative take (reverse)
const lastUsers = await prisma.user.findMany({
take: -10,
orderBy: { id: 'asc' }
})
// Returns last 10 userscursor
Cursor-based pagination:
// First page
const firstPage = await prisma.user.findMany({
take: 10,
orderBy: { id: 'asc' }
})
// Next page using cursor
const nextPage = await prisma.user.findMany({
take: 10,
skip: 1, // Skip the cursor record
cursor: { id: firstPage[firstPage.length - 1].id },
orderBy: { id: 'asc' }
})distinct
Return unique values:
const cities = await prisma.user.findMany({
distinct: ['city'],
select: { city: true }
})Multiple distinct fields
const locations = await prisma.user.findMany({
distinct: ['city', 'country']
}){
"name": "prisma-client-api-query-options",
"version": "7.0.0",
"author": "prisma",
"license": "MIT"
}Related skills
FAQ
What does prisma-client-api-query-options do?
prisma-client-api-query-options documents select, include, and pagination options.
When should I use prisma-client-api-query-options?
User configures select, include, orderBy, or cursor pagination.
Is this skill safe to install?
Review the Security Audits panel on this page before installing in production.