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
2 answers
GraphQLError: Unknown directive "@link"
Trying to test the new Apollo Federation 2 and followed the documentation as specified.
To create a 'true' federation 2 subgraph, the docs ask to put the following in the typedef:
extend schema
@link(
url:…

J Singh
- 59
- 11
0
votes
1 answer
Apollo Client state management
I have a situation where I need to save user input on multiple UI pages and then send accumulated data to some 3rd party backend service.
I wanted to understand if Apollo Client is capable of storing user input on each page in its cache and then…

Stranger95
- 123
- 1
- 9
0
votes
1 answer
Is there any way to set default value for extended property in subgraph, for case of if property is null in supergraph?
type Book @key(fields: "id language country name desc") @extends {
id: ID! @external
language: String! @external
country: String @external
name: String! @external
description: String! @external
information: MetaInformation…

E Behrangi
- 41
- 1
- 9
0
votes
1 answer
Does using Apollo Federation with microservices actually make any sense?
We recently switched our tech stack from multiple, fully-encapsulated microservices to Apollo Federation. Each microservice was converted to a subgraph and the supergraph is federated by the gateway.
But lately it feels like we've lost some of the…

sharknado
- 25
- 12
0
votes
1 answer
Apollo federation can't start gateway
Hello I want to use federation.I followed this tutorial. I can start my subgraph but when I start my gateway, I get this error:
Error: A valid schema couldn't be composed. The following composition errors were found:
Cannot extend type…

Mj Ebrahimzadeh
- 587
- 9
- 22
0
votes
1 answer
Has Apollo Federation support code-first approach?
I have code-first declarations on project. But I want to use them as microservices. In this case, how can i separate my typeDefs and resolvers according to Apollo's schema-first approach. Is it possible ?. I didn't find any resources that contain…

Batuhan
- 1,521
- 12
- 29
0
votes
1 answer
GraphQL with ElasticSearch and multiple indexes
I am new to GraphQL and have few questions on usage with ElasticSearch. It may not be right platform to ask as it is more like design question. But any pointers to my questions will surely help me to progress.
We are using ElasticSearch as DB with…

ac184
- 811
- 2
- 10
- 19
0
votes
1 answer
How to differentiate between a resolver call from federation and from client?
I am working in a GraphQL project using node + typegraphql + apollo-server.
My goal is to have specific metrics for regular queries, and separately, from federations. Is it possible to differentiate it in the server that is being requested and…

Marc Pascual
- 11
- 5
0
votes
1 answer
Apollo federation file upload
I have a problem in uploading file in apollo federation subgraph, this is my code in apollo gateway
import {
ApolloGateway,
// RemoteGraphQLDataSource //replace by FileUploadDataSource from @profusion/apollo-federation-upload for file upload
} from…

Generic Technology
- 23
- 6
0
votes
1 answer
How to get complete details from request coming from gateway to services using Apollo Federation
I'm trying to implement Auth0 in Apollo Federation, I was able to implement it in its individual services (https://auth0.com/blog/developing-a-secure-api-with-nestjs-adding-authorization/#Set-Up-API-Authorization) but if I'm trying to access the…

Hey000123
- 1
- 1
0
votes
0 answers
Why does field of extended type resolve to null? - Apollo Federation
Consider 2 services (A and B). B extends a type that is defined in A, but also adds a new field that's not in A. However, the resolvers in A that return that type don't resolve that field that B introduced (returns null). The Apollo Docs mention…

Chris Krogh
- 184
- 4
- 16
0
votes
1 answer
Apollo Federated Gateway returns an error when trying to use a .NET Core GraphQL federated subgraph
I am trying to learn Apollo Federation, so I started by looking at their sample (https://github.com/apollographql/federation-demo). This sample repository works great, and I can add a new service as a subgraph in Node.js.
I want to add a new service…

myermian
- 31,823
- 24
- 123
- 215
0
votes
1 answer
GraphQL Federation Nodemon breaks Gateway on Restart
I'm struggeling to setup my GraphQL Federation development environment. I have a few services and I want the server to automatically restart whenever a file changes. I am using Typescript, so Typescript has to transpile first into the dist folder…

mfaorlkzus
- 149
- 3
- 14
0
votes
1 answer
In Apollo GraphQl Federation, how to apply @requires logic without @external directive?
I have three microservices: Service A, Service B, and Service C in Apollo GraphQl Federation. All services have database models which are Model A, Model B, Model C. Every service has its own DB.
Model A has a field bIds that holds ID array of B…

Efe AYDIN
- 193
- 12
0
votes
1 answer
Apollo federation can 2 services return different models for same method
I have extended an entity and added a field to it like fieldA that returns a type interfaceA. Is it possible to have different services return different implementations of that type. like service one return implA and service 2 returns implB so…

user2419598
- 121
- 1
- 7