UNPKG

1.86 kBTypeScriptView Raw
1import { DocumentNode, DirectiveNode, FragmentDefinitionNode, ArgumentNode, FragmentSpreadNode, VariableDefinitionNode } from 'graphql';
2export declare type RemoveNodeConfig<N> = {
3 name?: string;
4 test?: (node: N) => boolean;
5 remove?: boolean;
6};
7export declare type GetNodeConfig<N> = {
8 name?: string;
9 test?: (node: N) => boolean;
10};
11export declare type RemoveDirectiveConfig = RemoveNodeConfig<DirectiveNode>;
12export declare type GetDirectiveConfig = GetNodeConfig<DirectiveNode>;
13export declare type RemoveArgumentsConfig = RemoveNodeConfig<ArgumentNode>;
14export declare type GetFragmentSpreadConfig = GetNodeConfig<FragmentSpreadNode>;
15export declare type RemoveFragmentSpreadConfig = RemoveNodeConfig<FragmentSpreadNode>;
16export declare type RemoveFragmentDefinitionConfig = RemoveNodeConfig<FragmentDefinitionNode>;
17export declare type RemoveVariableDefinitionConfig = RemoveNodeConfig<VariableDefinitionNode>;
18export declare function removeDirectivesFromDocument(directives: RemoveDirectiveConfig[], doc: DocumentNode): DocumentNode | null;
19export declare function addTypenameToDocument(doc: DocumentNode): DocumentNode;
20export declare function removeConnectionDirectiveFromDocument(doc: DocumentNode): DocumentNode;
21export declare function getDirectivesFromDocument(directives: GetDirectiveConfig[], doc: DocumentNode): DocumentNode;
22export declare function removeArgumentsFromDocument(config: RemoveArgumentsConfig[], doc: DocumentNode): DocumentNode;
23export declare function removeFragmentSpreadFromDocument(config: RemoveFragmentSpreadConfig[], doc: DocumentNode): DocumentNode;
24export declare function buildQueryFromSelectionSet(document: DocumentNode): DocumentNode;
25export declare function removeClientSetsFromDocument(document: DocumentNode): DocumentNode | null;
26//# sourceMappingURL=transform.d.ts.map
\No newline at end of file