Skip to content

Commit

Permalink
fix subscribe in add-graphql
Browse files Browse the repository at this point in the history
  • Loading branch information
hayes committed Nov 1, 2024
1 parent c790429 commit 7a4fa4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/thin-jeans-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@pothos/plugin-add-graphql": patch
---

Fix added subscription fields with custom subscribe method
3 changes: 3 additions & 0 deletions packages/plugin-add-graphql/src/schema-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ proto.addGraphQLObject = function addGraphQLObject<Shape>(
args,
description: field.description ?? undefined,
deprecationReason: field.deprecationReason ?? undefined,
extensions: field.extensions,
resolve: (field.resolve ?? defaultFieldResolver) as never,
...(field.subscribe ? { subscribe: field.subscribe } : {}),
});
}

Expand Down Expand Up @@ -219,6 +221,7 @@ proto.addGraphQLInterface = function addGraphQLInterface<Shape = unknown>(
description: field.description ?? undefined,
deprecationReason: field.deprecationReason ?? undefined,
resolve: field.resolve as never,
extensions: field.extensions,
});
}

Expand Down

0 comments on commit 7a4fa4c

Please sign in to comment.