Docs
API Reference
Packages
federation

@graphql-tools/federation

Table of contents

Variables

Functions

Variables

SubgraphBaseSDL

Const SubgraphBaseSDL: "\n scalar _Any\n scalar _FieldSet\n scalar link__Import\n\n enum link__Purpose {\n SECURITY\n EXECUTION\n }\n\n type _Service {\n sdl: String!\n }\n\n type Query {\n _entities(representations: [_Any!]!): [_Entity]!\n _service: _Service!\n }\n\n directive @external on FIELD_DEFINITION | OBJECT\n directive @requires(fields: _FieldSet!) on FIELD_DEFINITION\n directive @provides(fields: _FieldSet!) on FIELD_DEFINITION\n directive @key(fields: _FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE\n directive @link(url: String!, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA\n directive @shareable repeatable on OBJECT | FIELD_DEFINITION\n directive @inaccessible on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION\n directive @tag(\n name: String!\n ) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION\n directive @override(from: String!) on FIELD_DEFINITION\n directive @composeDirective(name: String!) repeatable on SCHEMA\n\n directive @extends on OBJECT | INTERFACE\n"

Defined in

packages/federation/src/index.ts:30 (opens in a new tab)


SubgraphSDLQuery

Const SubgraphSDLQuery: "\n query SubgraphSDL {\n _service {\n sdl\n }\n }\n"

Defined in

packages/federation/src/index.ts:65 (opens in a new tab)

Functions

buildSubgraphSchema

buildSubgraphSchema<TContext>(opts): GraphQLSchema

Type parameters

NameType
TContextany

Parameters

NameType
optsIExecutableSchemaDefinition<TContext>

Returns

GraphQLSchema

Defined in

packages/federation/src/index.ts:251 (opens in a new tab)


federationSubschemaTransformer

federationSubschemaTransformer(subschemaConfig): SubschemaConfig<any, any, any, Record<string, any>> | SubschemaConfig<any, any, any, Record<string, any>>[]

Parameters

NameType
subschemaConfigSubschemaConfig<any, any, any, Record<string, any>>

Returns

SubschemaConfig<any, any, any, Record<string, any>> | SubschemaConfig<any, any, any, Record<string, any>>[]

Defined in

packages/stitch/src/types.ts:65 (opens in a new tab)


getStitchedSchemaWithUrls

getStitchedSchemaWithUrls(configs): Promise<GraphQLSchema>

Parameters

NameType
configsHTTPExecutorOptions[]

Returns

Promise<GraphQLSchema>

Defined in

packages/federation/src/index.ts:229 (opens in a new tab)


getSubschemaForFederationWithExecutor

getSubschemaForFederationWithExecutor(executor): Promise<{ batch?: boolean ; batchingOptions?: BatchingOptions<any, any, any> ; createProxyingResolver?: CreateProxyingResolverFn<Record<string, any>> ; executor: Executor ; merge?: Record<string, MergedTypeConfig<any, any, Record<string, any>>> ; rootValue?: any ; schema: GraphQLSchema ; transforms?: Transform<any, Record<string, any>>[] }>

Parameters

NameType
executorExecutor

Returns

Promise<{ batch?: boolean ; batchingOptions?: BatchingOptions<any, any, any> ; createProxyingResolver?: CreateProxyingResolverFn<Record<string, any>> ; executor: Executor ; merge?: Record<string, MergedTypeConfig<any, any, Record<string, any>>> ; rootValue?: any ; schema: GraphQLSchema ; transforms?: Transform<any, Record<string, any>>[] }>

Defined in

packages/federation/src/index.ts:200 (opens in a new tab)


getSubschemaForFederationWithSchema

getSubschemaForFederationWithSchema(schema): Promise<{ batch?: boolean ; batchingOptions?: BatchingOptions<any, any, any> ; createProxyingResolver?: CreateProxyingResolverFn<Record<string, any>> ; executor: Executor ; merge?: Record<string, MergedTypeConfig<any, any, Record<string, any>>> ; rootValue?: any ; schema: GraphQLSchema ; transforms?: Transform<any, Record<string, any>>[] }>

Parameters

NameType
schemaGraphQLSchema

Returns

Promise<{ batch?: boolean ; batchingOptions?: BatchingOptions<any, any, any> ; createProxyingResolver?: CreateProxyingResolverFn<Record<string, any>> ; executor: Executor ; merge?: Record<string, MergedTypeConfig<any, any, Record<string, any>>> ; rootValue?: any ; schema: GraphQLSchema ; transforms?: Transform<any, Record<string, any>>[] }>

Defined in

packages/federation/src/index.ts:224 (opens in a new tab)


getSubschemaForFederationWithTypeDefs

getSubschemaForFederationWithTypeDefs(typeDefs): SubschemaConfig

Parameters

NameType
typeDefsDocumentNode

Returns

SubschemaConfig

Defined in

packages/federation/src/index.ts:90 (opens in a new tab)


getSubschemaForFederationWithURL

getSubschemaForFederationWithURL(config): Promise<SubschemaConfig>

Parameters

NameType
configHTTPExecutorOptions

Returns

Promise<SubschemaConfig>

Defined in

packages/federation/src/index.ts:81 (opens in a new tab)