graphql-composer
Version: 
Create your GraphQL API using composition!
26 lines (25 loc) • 1.03 kB
TypeScript
import { RequestType, Selection, Variable, KeyValue, InputFieldType } from "..";
export declare type ArgValue<T> = {
    []?: Partial<T[P]> | string | any;
};
export declare class Request<ArgsType = any> {
    private _type;
    private _name;
    private _args;
    private _selections;
    private _variables;
    get source(): string;
    get name(): string;
    get selections(): Selection<any>;
    get args(): ArgValue<ArgsType>;
    get type(): import("graphql").OperationTypeNode;
    get variables(): Variable[];
    protected constructor(type: RequestType, name: string, args: ArgValue<ArgsType>);
    static create<ArgsType = any>(type: RequestType, name: string, args: ArgValue<ArgsType>): Request<ArgsType>;
    select(selections: Selection): this;
    setVariables(...variables: Variable[]): this;
    protected parseVariables(): string;
    protected parseArgs(obj: KeyValue): string;
    protected parseType(type: InputFieldType): any;
    protected parseSelections(selections: Selection): string;
}