1 | import { GraphQLInterfaceType, GraphQLNamedType, GraphQLObjectType, GraphQLOutputType } from 'graphql';
|
2 | import { AvoidOptionalsConfig, ConvertNameFn, NormalizedScalarsMap } from '../types.js';
|
3 | export type PrimitiveField = {
|
4 | isConditional: boolean;
|
5 | fieldName: string;
|
6 | };
|
7 | export type PrimitiveAliasedFields = {
|
8 | alias: string;
|
9 | fieldName: string;
|
10 | };
|
11 | export type LinkField = {
|
12 | alias: string;
|
13 | name: string;
|
14 | type: string;
|
15 | selectionSet: string;
|
16 | };
|
17 | export type NameAndType = {
|
18 | name: string;
|
19 | type: string;
|
20 | };
|
21 | export type ProcessResult = null | Array<NameAndType | string>;
|
22 | export type SelectionSetProcessorConfig = {
|
23 | namespacedImportName: string | null;
|
24 | convertName: ConvertNameFn<any>;
|
25 | enumPrefix: boolean | null;
|
26 | enumSuffix: boolean | null;
|
27 | scalars: NormalizedScalarsMap;
|
28 | formatNamedField(name: string, type?: GraphQLOutputType | GraphQLNamedType | null, isConditional?: boolean, isOptional?: boolean): string;
|
29 | wrapTypeWithModifiers(baseType: string, type: GraphQLOutputType | GraphQLNamedType): string;
|
30 | avoidOptionals?: AvoidOptionalsConfig | boolean;
|
31 | };
|
32 | export declare class BaseSelectionSetProcessor<Config extends SelectionSetProcessorConfig> {
|
33 | config: Config;
|
34 | constructor(config: Config);
|
35 | buildFieldsIntoObject(allObjectsMerged: string[]): string;
|
36 | buildSelectionSetFromStrings(pieces: string[]): string;
|
37 | transformPrimitiveFields(_schemaType: GraphQLObjectType | GraphQLInterfaceType, _fields: PrimitiveField[], _unsetTypes?: boolean): ProcessResult;
|
38 | transformAliasesPrimitiveFields(_schemaType: GraphQLObjectType | GraphQLInterfaceType, _fields: PrimitiveAliasedFields[], _unsetTypes?: boolean): ProcessResult;
|
39 | transformLinkFields(_fields: LinkField[], _unsetTypes?: boolean): ProcessResult;
|
40 | transformTypenameField(_type: string, _name: string): ProcessResult;
|
41 | }
|