Skip to content

Remove 'assertValidExecutionArguments' function #3643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions src/execution/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,6 @@ function buildResponse(
return errors.length === 0 ? { data } : { errors, data };
}

/**
* Essential assertions before executing to provide developer feedback for
* improper use of the GraphQL library.
*
* TODO: consider no longer exporting this function
* @internal
*/
export function assertValidExecutionArguments(schema: GraphQLSchema): void {
// If the schema used for execution is invalid, throw an error.
assertValidSchema(schema);
}

/**
* Constructs a ExecutionContext object from the arguments passed to
* execute, which we will pass throughout the other execution methods.
Expand All @@ -267,8 +255,8 @@ export function buildExecutionContext(
subscribeFieldResolver,
} = args;

// If arguments are missing or incorrect, throw an error.
assertValidExecutionArguments(schema);
// If the schema used for execution is invalid, throw an error.
assertValidSchema(schema);

let operation: OperationDefinitionNode | undefined;
const fragments: ObjMap<FragmentDefinitionNode> = Object.create(null);
Expand Down