Skip to content

Commit

Permalink
Remove 'assertValidExecutionArguments' function (graphql#3643)
Browse files Browse the repository at this point in the history
After we drop runtime typechecks that were duplicating TS types this
function became a wrapper for 'assertValidSchema' so all implementations
that rely on it can now use 'assertValidSchema' directly.
  • Loading branch information
IvanGoncharov authored Jun 14, 2022
1 parent a4b085b commit cfbc023
Showing 1 changed file with 2 additions and 14 deletions.
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

0 comments on commit cfbc023

Please sign in to comment.