diff --git a/.changeset/selfish-drinks-flow.md b/.changeset/selfish-drinks-flow.md new file mode 100644 index 0000000..e2995e9 --- /dev/null +++ b/.changeset/selfish-drinks-flow.md @@ -0,0 +1,6 @@ +--- +"objection-graphql-resolver": minor +"graphql-orm": minor +--- + +Type graph resolve result as `Promise` instead of `Query`. diff --git a/packages/graphql-orm/src/resolvers/graph.ts b/packages/graphql-orm/src/resolvers/graph.ts index 871369e..a2abfa8 100644 --- a/packages/graphql-orm/src/resolvers/graph.ts +++ b/packages/graphql-orm/src/resolvers/graph.ts @@ -33,10 +33,10 @@ export class GraphResolver { readonly options: GraphResolverOptions = {}, ) {} - resolve( + resolve( query: Orm["Query"], { info, ...context }: GraphResolveOptions, - ) { + ): Promise { const tree = this._get_resolve_tree(info) return this._resolve_type(query, { ...context, tree }) } diff --git a/packages/objection-graphql-resolver/src/resolvers/graph.ts b/packages/objection-graphql-resolver/src/resolvers/graph.ts index 7da0b5c..a640b52 100644 --- a/packages/objection-graphql-resolver/src/resolvers/graph.ts +++ b/packages/objection-graphql-resolver/src/resolvers/graph.ts @@ -30,8 +30,8 @@ class ObjectionGraphResolver extends GraphResolver< resolve( query: Query, options: GraphResolveOptions, - ): Query { - return super.resolve(query, options) as Query + ): Promise { + return super.resolve(query, options) } resolvePage>(