UNPKG

2.47 kBTypeScriptView Raw
1import { DocumentNode, FieldDefinitionNode, DirectiveDefinitionNode, DirectiveNode, FieldNode, InlineFragmentNode } from 'graphql';
2export declare type Maybe<T> = null | undefined | T;
3export declare type ServiceName = string | null;
4export declare type DefaultRootOperationTypeName = 'Query' | 'Mutation' | 'Subscription';
5export interface ExternalFieldDefinition {
6 field: FieldDefinitionNode;
7 parentTypeName: string;
8 serviceName: string;
9}
10export interface ServiceNameToKeyDirectivesMap {
11 [serviceName: string]: FieldSet[] | undefined;
12}
13export declare type DirectiveUsages = Map<string, DirectiveNode[]>;
14export interface FederationType {
15 serviceName?: ServiceName;
16 keys?: ServiceNameToKeyDirectivesMap;
17 externals?: {
18 [serviceName: string]: ExternalFieldDefinition[];
19 };
20 isValueType?: boolean;
21 directiveUsages?: DirectiveUsages;
22}
23export declare type FieldSet = readonly (FieldNode | InlineFragmentNode)[];
24export interface FederationField {
25 serviceName?: ServiceName;
26 requires?: FieldSet;
27 provides?: FieldSet;
28 belongsToValueType?: boolean;
29 directiveUsages?: DirectiveUsages;
30}
31export interface FederationDirective {
32 directiveDefinitions: {
33 [serviceName: string]: DirectiveDefinitionNode;
34 };
35}
36export interface ServiceDefinition {
37 typeDefs: DocumentNode;
38 name: string;
39 url?: string;
40}
41declare module 'graphql/language/ast' {
42 interface UnionTypeDefinitionNode {
43 serviceName?: string | null;
44 }
45 interface UnionTypeExtensionNode {
46 serviceName?: string | null;
47 }
48 interface EnumTypeDefinitionNode {
49 serviceName?: string | null;
50 }
51 interface EnumTypeExtensionNode {
52 serviceName?: string | null;
53 }
54 interface ScalarTypeDefinitionNode {
55 serviceName?: string | null;
56 }
57 interface ScalarTypeExtensionNode {
58 serviceName?: string | null;
59 }
60 interface ObjectTypeDefinitionNode {
61 serviceName?: string | null;
62 }
63 interface ObjectTypeExtensionNode {
64 serviceName?: string | null;
65 }
66 interface InterfaceTypeDefinitionNode {
67 serviceName?: string | null;
68 }
69 interface InterfaceTypeExtensionNode {
70 serviceName?: string | null;
71 }
72 interface InputObjectTypeDefinitionNode {
73 serviceName?: string | null;
74 }
75 interface InputObjectTypeExtensionNode {
76 serviceName?: string | null;
77 }
78}
79//# sourceMappingURL=types.d.ts.map
\No newline at end of file