transform.d.ts 1.8 KB

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