1 | import { DirectiveNode, FieldDefinitionNode, GraphQLNamedType, GraphQLObjectType, GraphQLSchema, ObjectTypeDefinitionNode } from 'graphql';
|
2 |
|
3 |
|
4 |
|
5 | export declare const federationSpec: import("graphql").DocumentNode;
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | export declare function addFederationReferencesToSchema(schema: GraphQLSchema): GraphQLSchema;
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export declare function removeFederation(schema: GraphQLSchema): GraphQLSchema;
|
17 | interface TypeMeta {
|
18 | hasResolveReference: boolean;
|
19 | }
|
20 | export declare class ApolloFederation {
|
21 | private enabled;
|
22 | private schema;
|
23 | private providesMap;
|
24 | protected meta: {
|
25 | [typename: string]: TypeMeta;
|
26 | };
|
27 | constructor({ enabled, schema }: {
|
28 | enabled: boolean;
|
29 | schema: GraphQLSchema;
|
30 | });
|
31 | /**
|
32 | * Excludes types definde by Federation
|
33 | * @param typeNames List of type names
|
34 | */
|
35 | filterTypeNames(typeNames: string[]): string[];
|
36 | /**
|
37 | * Excludes `__resolveReference` fields
|
38 | * @param fieldNames List of field names
|
39 | */
|
40 | filterFieldNames(fieldNames: string[]): string[];
|
41 | /**
|
42 | * Decides if directive should not be generated
|
43 | * @param name directive's name
|
44 | */
|
45 | skipDirective(name: string): boolean;
|
46 | /**
|
47 | * Decides if scalar should not be generated
|
48 | * @param name directive's name
|
49 | */
|
50 | skipScalar(name: string): boolean;
|
51 | /**
|
52 | * Decides if field should not be generated
|
53 | * @param data
|
54 | */
|
55 | skipField({ fieldNode, parentType }: {
|
56 | fieldNode: FieldDefinitionNode;
|
57 | parentType: GraphQLNamedType;
|
58 | }): boolean;
|
59 | isResolveReferenceField(fieldNode: FieldDefinitionNode): boolean;
|
60 | /**
|
61 | * Transforms ParentType signature in ObjectTypes involved in Federation
|
62 | * @param data
|
63 | */
|
64 | transformParentType({ fieldNode, parentType, parentTypeSignature, }: {
|
65 | fieldNode: FieldDefinitionNode;
|
66 | parentType: GraphQLNamedType;
|
67 | parentTypeSignature: string;
|
68 | }): string;
|
69 | setMeta(typename: string, update: Partial<TypeMeta>): void;
|
70 | getMeta(): {
|
71 | [typename: string]: TypeMeta;
|
72 | };
|
73 | private isExternalAndNotProvided;
|
74 | private isExternal;
|
75 | private hasProvides;
|
76 | private translateFieldSet;
|
77 | private extractFieldSet;
|
78 | private createMapOfProvides;
|
79 | }
|
80 |
|
81 |
|
82 |
|
83 |
|
84 | export declare function checkObjectTypeFederationDetails(node: ObjectTypeDefinitionNode | GraphQLObjectType, schema: GraphQLSchema): {
|
85 | resolvableKeyDirectives: readonly DirectiveNode[];
|
86 | } | false;
|
87 | export {};
|