@apollo/federation
Version:
Apollo Federation Utilities
79 lines • 2.47 kB
TypeScript
import { DocumentNode, FieldDefinitionNode, DirectiveDefinitionNode, DirectiveNode, FieldNode, InlineFragmentNode } from 'graphql';
export declare type Maybe<T> = null | undefined | T;
export declare type ServiceName = string | null;
export declare type DefaultRootOperationTypeName = 'Query' | 'Mutation' | 'Subscription';
export interface ExternalFieldDefinition {
field: FieldDefinitionNode;
parentTypeName: string;
serviceName: string;
}
export interface ServiceNameToKeyDirectivesMap {
[serviceName: string]: FieldSet[] | undefined;
}
export declare type DirectiveUsages = Map<string, DirectiveNode[]>;
export interface FederationType {
serviceName?: ServiceName;
keys?: ServiceNameToKeyDirectivesMap;
externals?: {
[serviceName: string]: ExternalFieldDefinition[];
};
isValueType?: boolean;
directiveUsages?: DirectiveUsages;
}
export declare type FieldSet = readonly (FieldNode | InlineFragmentNode)[];
export interface FederationField {
serviceName?: ServiceName;
requires?: FieldSet;
provides?: FieldSet;
belongsToValueType?: boolean;
directiveUsages?: DirectiveUsages;
}
export interface FederationDirective {
directiveDefinitions: {
[serviceName: string]: DirectiveDefinitionNode;
};
}
export interface ServiceDefinition {
typeDefs: DocumentNode;
name: string;
url?: string;
}
declare module 'graphql/language/ast' {
interface UnionTypeDefinitionNode {
serviceName?: string | null;
}
interface UnionTypeExtensionNode {
serviceName?: string | null;
}
interface EnumTypeDefinitionNode {
serviceName?: string | null;
}
interface EnumTypeExtensionNode {
serviceName?: string | null;
}
interface ScalarTypeDefinitionNode {
serviceName?: string | null;
}
interface ScalarTypeExtensionNode {
serviceName?: string | null;
}
interface ObjectTypeDefinitionNode {
serviceName?: string | null;
}
interface ObjectTypeExtensionNode {
serviceName?: string | null;
}
interface InterfaceTypeDefinitionNode {
serviceName?: string | null;
}
interface InterfaceTypeExtensionNode {
serviceName?: string | null;
}
interface InputObjectTypeDefinitionNode {
serviceName?: string | null;
}
interface InputObjectTypeExtensionNode {
serviceName?: string | null;
}
}
//# sourceMappingURL=types.d.ts.map