@graphql-eslint/eslint-plugin
Version:
GraphQL plugin for ESLint
25 lines (22 loc) • 1.04 kB
text/typescript
import { FragmentDefinitionNode, OperationDefinitionNode, SelectionSetNode, OperationTypeNode } from 'graphql';
import { Source } from '@graphql-tools/utils';
type FragmentSource = {
filePath: string;
document: FragmentDefinitionNode;
};
type OperationSource = {
filePath: string;
document: OperationDefinitionNode;
};
type SiblingOperations = {
available: boolean;
getFragment(fragmentName: string): FragmentSource[];
getFragments(): FragmentSource[];
getFragmentByType(typeName: string): FragmentSource[];
getFragmentsInUse(baseOperation: FragmentDefinitionNode | OperationDefinitionNode | SelectionSetNode, recursive?: boolean): FragmentDefinitionNode[];
getOperation(operationName: string): OperationSource[];
getOperations(): OperationSource[];
getOperationByType(operationType: OperationTypeNode): OperationSource[];
};
declare function getSiblings(documents: Source[]): SiblingOperations;
export { type FragmentSource, type OperationSource, type SiblingOperations, getSiblings };