apollo-schema-extend
Version:
Extends your Apollo Server Express based graphql server with an external graphql source
10 lines (9 loc) • 666 B
TypeScript
import { FieldNode, FragmentDefinitionNode, InlineFragmentNode, OperationDefinitionNode, SelectionNode } from 'graphql';
/**
* Creates a field AST
* @param {string} name
* @param {string|undefined} alias
*/
export declare const createField: (name: string, alias?: string) => FieldNode;
export declare const withSelections: <TNode extends OperationDefinitionNode | FragmentDefinitionNode | FieldNode | InlineFragmentNode>(node: TNode, selections: SelectionNode[]) => TNode;
export declare const addSelections: <TNode extends OperationDefinitionNode | FragmentDefinitionNode | FieldNode | InlineFragmentNode>(node: TNode, ...selections: SelectionNode[]) => TNode;