Skip to content

Commit

Permalink
Fix custom descriptions on t.expose* on prisma objects
Browse files Browse the repository at this point in the history
  • Loading branch information
hayes committed Aug 8, 2023
1 parent 8db542b commit 016011f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/sharp-cars-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@pothos/plugin-prisma': patch
---

Fix custom descriptions in t.expose methods
2 changes: 1 addition & 1 deletion packages/plugin-prisma/src/prisma-field-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ export class PrismaObjectFieldBuilder<
]
>
): FieldRef<ShapeFromTypeParam<Types, Type, Nullable>, 'PrismaObject'> => {
const [name, { description, ...options } = {} as never] = args;
const [name, options = {} as never] = args;

return this.expose<Type, Nullable, ResolveReturnShape, never>(
name as never,
Expand Down
4 changes: 0 additions & 4 deletions packages/plugin-prisma/tests/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ type Post {
commentAuthorIds: [ID!]!
comments: [Comment!]!
commentsConnection(after: ID, before: ID, first: Int, last: Int): CommentConnection!
\\"\\"\\"Content for the post\\"\\"\\"
content: String
createdAt: String!
id: ID!
Expand Down Expand Up @@ -336,8 +334,6 @@ type QueryWithIDSelectConnectionEdge {
\\"\\"\\"Model for Posts!\\"\\"\\"
type SelectPost implements Node {
comments(after: ID, before: ID, first: Int, last: Int): CommentConnection!
\\"\\"\\"Content for the post\\"\\"\\"
content: String
createdAt: String!
id: ID!
Expand Down

1 comment on commit 016011f

@vercel
Copy link

@vercel vercel bot commented on 016011f Aug 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.