Apollo Federation is an architecture for composing multiple GraphQL services into a single graph that addresses this need. Unlike other approaches such as schema stitching, it is based on a declarative composition programming model that allows proper separation of concerns. This design allows teams to implement an enterprise-scale shared data graph as a set of loosely coupled, separately maintained GraphQL services.
Questions tagged [apollo-federation]
208 questions
0
votes
0 answers
How to use nest js guard with GraphQL file upload mutation?
I am implementing file upload functionality in Nest JS GraphQL with Federation. I am using graphql-upload library for file upload. I have encountered an issue that when i send an invalid JWT which is being checked in the guard , The guard is…

Anas khan
- 175
- 1
- 3
- 13
0
votes
0 answers
How do I specify a separate way to load sub graph schema via ApolloGateway?
I am using ApolloGateway to federate multiple subgraphs into one. Below is the code. The gateway will try to retrieve graphql schema from subgraph endpoint and forward the request to those endpoints as well.
My problem is that the schema is not…

Joey Yi Zhao
- 37,514
- 71
- 268
- 523
0
votes
0 answers
Is there a way to load pre-federated schema by using Apollo Gateway?
I am using ApolloGateway to federate graphql subgraphs. Below is the demo code:
const gateway = new ApolloGateway({
supergraphSdl: new IntrospectAndCompose({
subgraphs: [
{ name: 'accounts', url: 'http://localhost:4001' },
{ name:…

Joey Yi Zhao
- 37,514
- 71
- 268
- 523
0
votes
1 answer
How to set different header for different subgraph via ApolloGateway?
I am using Apollo gateway to build a graphql federation service. Below is the demo code:
const gateway = new ApolloGateway({
supergraphSdl: new IntrospectAndCompose({
subgraphs: [
{ name: 'products', url:…

Joey Yi Zhao
- 37,514
- 71
- 268
- 523
0
votes
1 answer
Set-cookie headers are not being sent when calls are made through apollo federation gateway NestJs
I have a non monorepo nestJs graphql microservices app, and opted for Apollo federation gateway. I have an authentication server which works fine and sets cookies to header, only problem is when calls are made through apollo gateway set-cookie…

saafgh
- 33
- 8
0
votes
0 answers
How to move from schema stitching to federated subgraphs after upgrade of many libraries?
I need to move from schema stiching to federated subgraphs using graphql-compose, graphq-compose-mongoose, apollo-subgraph apollo-server after an upgrade of all the libraries
I have a gateway using apollo gateway that create a supergraphSDl using…

Anthony Levillon
- 11
- 3
0
votes
0 answers
Can't federate AWS Appsync if there is a custom type `AWSDateTime`
I am trying to use Apollo Federation to connect subgraph from AWS Appsync. When I start federation I got this error: UNKNOWN: Unknown type AWSDateTime. It seems Federation doesn't recognise AWS Scalar type AWSDateTime. Is there a way to extend…

Joey Yi Zhao
- 37,514
- 71
- 268
- 523
0
votes
2 answers
Apollo gateway gives an error when `@requires` fieldset has an entity which is resolved by two separate clients
I have 4 subgraph services namely products, couriers, cargo_service, tax. (Not a real-world example, just playing with graphql federation concepts).
Below is my code for those services.
products service
const { ApolloServer} =…

Ishad
- 121
- 1
- 11
0
votes
0 answers
Is the Apollo Federation loosely coupling?
I am pretty new to microservices architecture and Apollo Federation. I am curious: is the Apollo federation really loosely coupled? Because if a subgraph doesn't work in Node.js, the gateway also doesn't work. So the whole system will crash because…

Ertan Özdemir
- 67
- 6
0
votes
0 answers
Union of responses from two different subgraphs
I was looking into apollo federation but was not able to deduce from a first scan of their docs if I will be able to respond from the router with union of responses from two different subgraphs.
For example, I have two responses from subgraph…

zoid
- 1
- 2
0
votes
0 answers
How to resolve types from another subgraph in apollo federation v2
I am trying to design a graphql API and I want to use apollo federation v2.
I have two subgraph or micro-services:
Billing Subgraph: responsible to retrieve a bill for a customer
Payment Subgraph: responsible to fetch payment for a…

Varun
- 35
- 4
0
votes
1 answer
GraphQL - Apollo printSchema error: TypeError: Cannot read properties of undefined (reading 'kind')
I am trying to use the printSchema function from Apollo to include @directives in the GQL Schema.
However it keeps showing this error:
TypeError: Cannot read properties of undefined (reading 'kind')
at KnownDirectivesRule…

Sivvie Lim
- 784
- 2
- 14
- 43
0
votes
0 answers
@inaccessable directive not working apollo federation
i have been using this sample project :https://github.com/apollographql/federation-demo
to test @inaccessible and requires directives. @requires directive is working as expected but even after using @inaccessable directive i'm still see the field in…

Sunil Bhagat
- 99
- 10
0
votes
0 answers
How can setup Graphql Federation with apolloGateway in nestjs
Main App imports
imports: [
GraphQLModule.forRoot({
driver: ApolloGatewayDriver,
gateway: {
supergraphSdl: new IntrospectAndCompose({
subgraphs: [
{ name: 'users', url:…

yasermoamd
- 1
- 1
0
votes
1 answer
how to use neo4j/graphql in conjunction with nestjs-neo4j to access the neo4j schema directives
I am using:
nestjs v9
neo4j v4.5
neo4j/graphql v3
apollo server v4 w/federation
neo4jService from nestjs-neo4j
to create a neo4jGraphqlService that uses neo4jService for most neo4j DB interactions.
But I also want to use the neo4j/graphql…

MichaelE
- 757
- 14
- 42