Skip to content

Commit fa093fe

Browse files
authored
fix: Add plugin options types (#199)
1 parent b8de115 commit fa093fe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

index.d.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ interface DocumentationOptions {
3939
};
4040
}
4141

42+
interface PluginOptions {
43+
formats: Record<string, (value: unknown) => boolean>;
44+
}
45+
4246
/**
4347
* Schema transformer which adds @constraint directives documentation to the fields and arguments descriptions.
4448
* Documentation not added if it already exists (`header` is present in the field or argument description)
@@ -65,7 +69,7 @@ export function validateQuery () : (schema: GraphQLSchema, query: DocumentNode,
6569
/**
6670
* Create Apollo 3 plugin performing query validation.
6771
*/
68-
export function createApolloQueryValidationPlugin ( options: { schema: GraphQLSchema } ) : PluginDefinition;
72+
export function createApolloQueryValidationPlugin ( options: { schema: GraphQLSchema }, pluginOptions?: PluginOptions ) : PluginDefinition;
6973

7074
/**
7175
* Create JS GraphQL Validation Rule performing query validation.
@@ -75,4 +79,4 @@ export function createQueryValidationRule( options: { [key: string]: any }) : (c
7579
/**
7680
* Create Envelop plugin performing query validation.
7781
*/
78-
export function createEnvelopQueryValidationPlugin() : object;
82+
export function createEnvelopQueryValidationPlugin( pluginOptions?: PluginOptions ) : { onExecute: Function };

0 commit comments

Comments
 (0)