diff --git a/mod.ts b/mod.ts new file mode 100644 index 0000000..43b0318 --- /dev/null +++ b/mod.ts @@ -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"; diff --git a/types.ts b/types.ts index 0106acc..02508c3 100644 --- a/types.ts +++ b/types.ts @@ -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>; - typeResolver?: Maybe>; - subscribeFieldResolver?: Maybe>; + /** 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>; + + /** 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>; + + readonly subscribeFieldResolver?: Maybe>; }