-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(client): add more jsdoc to Prisma Client #4388
Conversation
e17bbf0
to
2adfbe3
Compare
eaa1189
to
267effa
Compare
@@ -115,7 +115,10 @@ export class Model implements Generatable { | |||
export type ${groupByArgsName} = { | |||
${indent( | |||
groupByRootField.args | |||
.map((arg) => new InputField(arg, false, arg.name === 'by').toTS()) | |||
.map((arg) => { | |||
arg.comment = getArgFieldJSDoc(model, DMMF.ModelAction.groupBy, arg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you build that into InputField?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have done that but it would take a while to implement
: '' | ||
}: Subset<T, ${getModelArgName(name, actionName)}> | ||
${actionName}${getGenericMethod(name, actionName)}( | ||
${getArgs(name, actionName)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did the conditions go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
into getArgs
01ed01c
to
9ba457c
Compare
cursor?: PostWhereUniqueInput | ||
/** | ||
* The number of Posts to aggregate. If negative number, it will take Posts before the \`cursor\`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will actually take the cursor too in results without skip: 1
So we need to find a better wording because "before" makes me think the cursor is not included but it is and you need to pass skip: 1
to exclude it
Example from docs
Example: Paging backwards with cusor-based pagination
To page backwards, set take to a negative value. The following query returns 4 Post records with an id of less than 200, excluding the cursor:
const myOldCursor = 200
const firstQueryResults = prisma.post.findMany({
take: -4,
skip: 1,
cursor: {
id: myOldCursor,
},
where: {
title: {
contains: 'Prisma' /* Optional filter */,
},
},
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Takes n
Posts from the position of the cursor, including the cursor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Takes n Posts from the position of the cursor, cursor included.
maybe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed it to
Take \`n\` Posts from the position of the cursor (cursor included). If negative number, it will take Posts before the \`cursor\`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the cursor is always included from what I understand.
This suggests the cursor is included only in one case
2e2c8be
to
f8bb1fe
Compare
2772e33
to
c9a481d
Compare
* master: fix(deps): update engines to v2.14.0-26.59cf08bf47e90cb37532900059f3328b4328237c (#4774) chore(deps): update definitelytyped fix(client): raw transactions (#4759) fix(deps): update engines to v2.14.0-22.85cf7930a5fc63cd99fa483153fd33cb35d49cfa chore(deps): update studio to v0.332.0 fix(client): improve error links (#4753) fix(deps): update engines to v2.14.0-21.aed47bccd0e3bc61e2a26b14315e2dd839d35a12 chore: bump engines (#4749) fix: fail early for known errors (#4734) chore: cleanup (#4707) fix(debug): allow multiple instances (#4665) chore: wip debug vercel (#4705) fix(deps): update engines to v2.14.0-17.af950b3705ef175e85492660c621085eb7f99557 chore(deps): update dependency rollup-plugin-dts to v2 (#4323) feat(client): add more jsdoc to Prisma Client (#4388) fix(deps): update engines to v2.14.0-16.c033861e8ed093701af214a25e2bb3e03edacf7c # Conflicts: # package.json # pnpm-lock.yaml # src/packages/client/package.json # src/packages/client/src/runtime/getPrismaClient.ts # src/packages/debug/package.json # src/packages/engine-core/package.json # src/packages/generator-helper/package.json # src/packages/get-platform/package.json # src/pnpm-lock.yaml
closes #4344