Skip to content

Commit

Permalink
feat(mod): export module and types
Browse files Browse the repository at this point in the history
  • Loading branch information
TomokiMiyauci committed Oct 13, 2022
1 parent 2b710e0 commit 71c2b48
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
5 changes: 5 additions & 0 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2022-latest the graphqland authors. All rights reserved. MIT license.
// This module is browser compatible.

export { createResponse } from "./response.ts";
export { type ExecutionParams } from "./types.ts";
28 changes: 22 additions & 6 deletions types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,27 @@ import {
Maybe,
} from "./deps.ts";

/** GraphQL execution parameters.
* The difference from `ExecutionArgs` in `graphql` is that the following fields are not present.
* - document
* - variableValues
* - operationName
*/
export interface ExecutionParams {
schema: GraphQLSchema;
rootValue?: unknown;
contextValue?: unknown;
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
typeResolver?: Maybe<GraphQLTypeResolver<any, any>>;
subscribeFieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
/** The GraphQL type system to use when validating and executing a query. */
readonly schema: GraphQLSchema;

/** The value provided as the first argument to resolver functions on the top level type (e.g. the query object type). */
readonly rootValue?: unknown;

/** The context value is provided as an argument to resolver functions after field arguments. It is used to pass shared information useful at any point during executing this query, for example the currently logged in user and connections to databases or other services. */
readonly contextValue?: unknown;

/** A resolver function to use when one is not provided by the schema. If not provided, the default field resolver is used (which looks for a value or method on the source value with the field's name). */
readonly fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;

/** A type resolver function to use when none is provided by the schema. If not provided, the default type resolver is used (which looks for a `__typename` field or alternatively calls the `isTypeOf` method). */
readonly typeResolver?: Maybe<GraphQLTypeResolver<any, any>>;

readonly subscribeFieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
}

0 comments on commit 71c2b48

Please sign in to comment.