Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Commit

Permalink
Fixes and improvements to comments (#754)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyarik committed Nov 3, 2022
1 parent 2061b09 commit 8b6ffc6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ export type Options =

export interface OptionsData {
/**
* A GraphQL schema from graphql-js.
* A GraphQL schema from `graphql-js`.
*/
schema: GraphQLSchema;

/**
* A value to pass as the context to this middleware.
* A value to pass as the `contextValue` to the `execute` function.
*/
context?: unknown;

/**
* An object to pass as the rootValue to the graphql() function.
* An object to pass as the `rootValue` to the `execute` function.
*/
rootValue?: unknown;

Expand All @@ -73,7 +73,7 @@ export interface OptionsData {

/**
* An optional array of validation rules that will be applied on the document
* in additional to those defined by the GraphQL spec.
* in addition to those defined by the GraphQL spec.
*/
validationRules?: ReadonlyArray<ValidationRule>;

Expand Down Expand Up @@ -107,8 +107,8 @@ export interface OptionsData {
customParseFn?: (source: Source) => DocumentNode;

/**
* `formatError` is deprecated and replaced by `customFormatErrorFn`. It will
* be removed in version 1.0.0.
* @deprecated `formatError` is deprecated and replaced by `customFormatErrorFn`.
* It will be removed in version 1.0.0.
*/
formatError?: (error: GraphQLError) => GraphQLFormattedError;

Expand Down Expand Up @@ -172,7 +172,7 @@ export interface RequestInfo {
result: FormattedExecutionResult;

/**
* A value to pass as the context to the graphql() function.
* The value passed as the `contextValue` to the `execute` function.
*/
context?: unknown;
}
Expand Down Expand Up @@ -278,7 +278,7 @@ export function graphqlHTTP(options: Options): Middleware {
try {
documentAST = parseFn(new Source(query, 'GraphQL request'));
} catch (syntaxError: unknown) {
// Return 400: Bad Request if any syntax errors errors exist.
// Return 400: Bad Request if any syntax errors exist.
throw httpError(400, 'GraphQL syntax error.', {
graphqlErrors: [syntaxError],
});
Expand Down

0 comments on commit 8b6ffc6

Please sign in to comment.