import { GraphQLArgument, GraphQLField, GraphQLSchema, GraphQLType } from 'graphql'; /** * Compile arguments dictionary for a field * @param field current field object * @param duplicateArgCounts map for deduping argument name collisions * @param allArgsDict dictionary of all arguments */ export declare const getFieldArgsDict: (field: GraphQLField, duplicateArgCounts: Record, allArgsDict?: Record) => Record; /** * Generate variables string * @param dict dictionary of arguments */ export declare const getArgsToVarsStr: (dict: Record) => string; /** * Generate types string * @param dict dictionary of arguments */ export declare const getVarsToTypesStr: (dict: Record) => string; /** * Generate a example value for a given a GraphQL type * @param type GraphQL type */ export declare const getSampleValueOfType: (type: GraphQLType) => any; export declare const getSampleVars: (dict: Record) => { [k: string]: any; }; export declare class GqlGenerator { private gqlSchema; private depthLimit; private includeDeprecatedFields; constructor(gqlSchema: GraphQLSchema, depthLimit?: number, includeDeprecatedFields?: boolean); /** * Generate a selection for the specified field * * @param fieldName name of a field on a GraphQL type * @param parentTypeName name of the parent GraphQL type * @param parentFieldName name of the parent field * @param argumentsDict dictionary of arguments from all fields * @param duplicateArgCounts map for deduping argument name collisions * @param crossReferenceKeyList list of the cross reference * @param curDepth current depth of field * @param fromUnion adds additional depth for unions to avoid empty child */ generateFieldSelection({ fieldName, parentTypeName, parentFieldName, argumentsDict, duplicateArgCounts, crossReferenceKeyList, // [`${parentFieldName}To${fieldName}Key`] curDepth, fromUnion, }: { fieldName: string; parentTypeName: string; parentFieldName?: string; argumentsDict?: Record; duplicateArgCounts?: Record; crossReferenceKeyList?: string[]; curDepth?: number; fromUnion?: boolean; }): { selection: string; argumentsDict: Record; }; generateSampleOperation(): { query: string; variables: Record; }; } export declare const generateSampleOperation: ({ schema, depthLimit, includeDeprecatedFields, }: { schema: GraphQLSchema; depthLimit?: number | undefined; includeDeprecatedFields?: boolean | undefined; }) => { query: string; variables: Record; }; export declare function isSameSchema(left: GraphQLSchema | undefined, right: GraphQLSchema | undefined): boolean; export declare function parseAndPrint(str: string): { parsedString: string; queryName: string; } | undefined; export declare function validateHistoricalQuery(queryObject: { query: string; variables: string; headers: string; operationName: string; }, schema?: GraphQLSchema): { query: string; variables: string; headers: string; operationName: string; } | undefined;