@graphql-tools/federation
Interfaces
Variables
Functions
- buildSubgraphSchema
- federationSubschemaTransformer
- filterInternalFieldsAndTypes
- getArgsFromKeysForFederation
- getCacheKeyFnFromKey
- getKeyFnForFederation
- getKeyForFederation
- getNamedTypeNode
- getStitchedSchemaFromSupergraphSdl
- getStitchedSchemaWithUrls
- getSubschemaForFederationWithExecutor
- getSubschemaForFederationWithSchema
- getSubschemaForFederationWithTypeDefs
- getSubschemaForFederationWithURL
- getSubschemasFromSupergraphSdl
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 _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(\n url: String!\n as: String\n for: link__Purpose\n import: [link__Import]\n ) 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/subgraph.ts:14
SubgraphSDLQuery
• Const
SubgraphSDLQuery: "\n query SubgraphSDL {\n _service {\n sdl\n }\n }\n"
Defined in
packages/federation/src/gateway.ts:32
Functions
buildSubgraphSchema
▸ buildSubgraphSchema<TContext
>(optsOrModules
): GraphQLSchema
Type parameters
Name | Type |
---|---|
TContext | any |
Parameters
Name | Type |
---|---|
optsOrModules | IExecutableSchemaDefinition <TContext > | Pick <IExecutableSchemaDefinition <TContext >, "resolvers" | "typeDefs" >[] |
Returns
GraphQLSchema
Defined in
packages/federation/src/subgraph.ts:53
federationSubschemaTransformer
▸ federationSubschemaTransformer(subschemaConfig
): SubschemaConfig
<any
, any
, any
, Record
<string
, any
>> | SubschemaConfig
<any
, any
, any
, Record
<string
, any
>>[]
Parameters
Name | Type |
---|---|
subschemaConfig | SubschemaConfig <any , any , any , Record <string , any >> |
Returns
SubschemaConfig
<any
, any
, any
, Record
<string
, any
>> | SubschemaConfig
<any
, any
, any
, Record
<string
, any
>>[]
Defined in
packages/federation/src/gateway.ts:222
filterInternalFieldsAndTypes
▸ filterInternalFieldsAndTypes(finalSchema
): GraphQLSchema
Parameters
Name | Type |
---|---|
finalSchema | GraphQLSchema |
Returns
GraphQLSchema
Defined in
packages/federation/src/utils.ts:43
getArgsFromKeysForFederation
▸ getArgsFromKeysForFederation(representations
): Object
Parameters
Name | Type |
---|---|
representations | readonly any [] |
Returns
Object
Name | Type |
---|---|
representations | readonly any [] |
Defined in
packages/federation/src/utils.ts:4
getCacheKeyFnFromKey
▸ getCacheKeyFnFromKey(key
): (root
: any
) => any
Parameters
Name | Type |
---|---|
key | string |
Returns
fn
▸ (root
): any
Parameters
Name | Type |
---|---|
root | any |
Returns
any
Defined in
packages/federation/src/utils.ts:29
getKeyFnForFederation
▸ getKeyFnForFederation(typeName
, keys
): (root
: any
) => any
Parameters
Name | Type |
---|---|
typeName | string |
keys | string [] |
Returns
fn
▸ (root
): any
Parameters
Name | Type |
---|---|
root | any |
Returns
any
Defined in
packages/federation/src/utils.ts:12
getKeyForFederation
▸ getKeyForFederation<TRoot
>(root
): TRoot
Type parameters
Name |
---|
TRoot |
Parameters
Name | Type |
---|---|
root | TRoot |
Returns
TRoot
Defined in
packages/federation/src/utils.ts:8
getNamedTypeNode
▸ getNamedTypeNode(typeNode
): NamedTypeNode
Parameters
Name | Type |
---|---|
typeNode | TypeNode |
Returns
NamedTypeNode
Defined in
packages/federation/src/utils.ts:66
getStitchedSchemaFromSupergraphSdl
▸ getStitchedSchemaFromSupergraphSdl(opts
): GraphQLSchema
Parameters
Name | Type |
---|---|
opts | GetSubschemasFromSupergraphSdlOpts |
Returns
GraphQLSchema
Defined in
packages/federation/src/supergraph.ts:551
getStitchedSchemaWithUrls
▸ getStitchedSchemaWithUrls(configs
): Promise
<GraphQLSchema
>
Parameters
Name | Type |
---|---|
configs | HTTPExecutorOptions [] |
Returns
Promise
<GraphQLSchema
>
Defined in
packages/federation/src/gateway.ts:212
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
Name | Type |
---|---|
executor | Executor |
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/gateway.ts:183
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
Name | Type |
---|---|
schema | GraphQLSchema |
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/gateway.ts:207
getSubschemaForFederationWithTypeDefs
▸ getSubschemaForFederationWithTypeDefs(typeDefs
): SubschemaConfig
Parameters
Name | Type |
---|---|
typeDefs | DocumentNode |
Returns
Defined in
packages/federation/src/gateway.ts:51
getSubschemaForFederationWithURL
▸ getSubschemaForFederationWithURL(config
): Promise
<SubschemaConfig
>
Parameters
Name | Type |
---|---|
config | HTTPExecutorOptions |
Returns
Promise
<SubschemaConfig
>
Defined in
packages/federation/src/gateway.ts:40
getSubschemasFromSupergraphSdl
▸ getSubschemasFromSupergraphSdl(«destructured»
): Map
<string
, SubschemaConfig
<any
, any
, any
, Record
<string
, any
>>>
Parameters
Name | Type |
---|---|
«destructured» | GetSubschemasFromSupergraphSdlOpts |
Returns
Map
<string
, SubschemaConfig
<any
, any
, any
, Record
<string
, any
>>>