Skip to content

Commit 64c1bf4

Browse files
committed
Use errors plugin
1 parent 58dddc3 commit 64c1bf4

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

deno.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"@pothos/core": "npm:@pothos/core@^4.7.3",
4343
"@pothos/plugin-complexity": "npm:@pothos/[email protected]",
4444
"@pothos/plugin-drizzle": "npm:@pothos/plugin-drizzle@^0.11.1",
45+
"@pothos/plugin-errors": "npm:@pothos/plugin-errors@^4.4.2",
4546
"@pothos/plugin-relay": "npm:@pothos/plugin-relay@^4.6.2",
4647
"@pothos/plugin-scope-auth": "npm:@pothos/plugin-scope-auth@^4.1.5",
4748
"@pothos/plugin-simple-objects": "npm:@pothos/plugin-simple-objects@^4.1.3",

deno.lock

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

graphql/builder.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type { Uuid } from "@hackerspub/models/uuid";
99
import SchemaBuilder from "@pothos/core";
1010
import ComplexityPlugin from "@pothos/plugin-complexity";
1111
import DrizzlePlugin from "@pothos/plugin-drizzle";
12+
import ErrorsPlugin from "@pothos/plugin-errors";
1213
import RelayPlugin from "@pothos/plugin-relay";
1314
import ScopeAuthPlugin from "@pothos/plugin-scope-auth";
1415
import SimpleObjectsPlugin from "@pothos/plugin-simple-objects";
@@ -29,6 +30,9 @@ import {
2930
import { createGraphQLError } from "graphql-yoga";
3031
import type Keyv from "keyv";
3132

33+
export type ValuesOfEnumType<T> = T extends
34+
PothosSchemaTypes.EnumRef<never, unknown, infer V> ? V : never;
35+
3236
export interface ServerContext {
3337
db: Database;
3438
kv: Keyv;
@@ -114,6 +118,7 @@ export const builder = new SchemaBuilder<PothosTypes>({
114118
SimpleObjectsPlugin,
115119
TracingPlugin,
116120
WithInputPlugin,
121+
ErrorsPlugin,
117122
],
118123
complexity: {
119124
defaultComplexity: 1,

0 commit comments

Comments
 (0)