Skip to content

Commit

Permalink
fix(utils): avoid global variable (#1791)
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Jul 16, 2020
1 parent 1f3b14a commit a4dd0ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/utils/src/validate-documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { Source } from './loaders';
import AggregateError from '@ardatan/aggregate-error';

export type ValidationRule = (context: ValidationContext) => ASTVisitor;
const DEFAULT_EFFECTIVE_RULES = createDefaultRules();

export interface LoadDocumentError {
readonly filePath: string;
Expand All @@ -22,8 +21,9 @@ export interface LoadDocumentError {
export async function validateGraphQlDocuments(
schema: GraphQLSchema,
documentFiles: Source[],
effectiveRules: ValidationRule[] = DEFAULT_EFFECTIVE_RULES
effectiveRules?: ValidationRule[]
): Promise<ReadonlyArray<LoadDocumentError>> {
effectiveRules = effectiveRules || createDefaultRules();
const allFragments: FragmentDefinitionNode[] = [];

documentFiles.forEach(documentFile => {
Expand Down

0 comments on commit a4dd0ea

Please sign in to comment.