Mirror: The spec-compliant minimum of client-side GraphQL.
1import type { Location, Source as _Source } from './types'; 2import type { ASTNode, SelectionNode } from './ast'; 3 4export function isSelectionNode(node: ASTNode): node is SelectionNode { 5 return node.kind === 'Field' || node.kind === 'FragmentSpread' || node.kind === 'InlineFragment'; 6} 7 8export function Source(body: string, name?: string, locationOffset?: Location): _Source { 9 return { 10 body, 11 name, 12 locationOffset: locationOffset || { line: 1, column: 1 }, 13 }; 14}