UNPKG

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