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
2
votes
0 answers
How can I provide input field arguments with apollo federation 2?
I am trying to federate two of my micro services with apollo gql federation 2.
I have successfully connected the two services through the federation with the following schemas:
Subgraph1 - Product
type Product @key(fields: "id") {
id: ID!
…

CaminoDS
- 41
- 4
2
votes
0 answers
GraphQLError: Type must define one or more fields
Problem
When I try to start this Federated Property Service, I get an error that says: GraphQLError: Type Property must define one or more fields.
The Schema that it generates looks correct, and has those fields populated, but when I add the…

farmlandbee
- 345
- 1
- 3
- 14
2
votes
0 answers
How to build an AWS serverless Apollo Federation API which is constructed from subgraphs in separate microservices?
The Task:
Imagine a large-ish company or product that has many microservices run by separate teams. Each microservice exists in a separate repo. You want to build a single unified Apollo GraphQL API which collates all the subgraphs from the separate…

Gene
- 616
- 4
- 8
2
votes
0 answers
Apollo Federation supergraph query gives an error
I got most of the tutorial up and running just fine, i.e subgraph creation, publishing subgraphs to Apollo Studio, and setting up the router.
When I try to run a unified query on the supergraph, however, I get the following…

painotpi
- 6,894
- 1
- 37
- 70
2
votes
0 answers
Type "AssetAccount" is an extension type, but there is no type definition for "AssetAccount" in any subgraph Apollo Federation NestJs
Am updating my nest js apollo federation and am getting this error.
/Users/leonlishenga/Documents/code/omnivoltaic/nest/microservices/microservices-apigateway/node_modules/@apollo/gateway/src/supergraphManagers/IntrospectAndCompose/index.ts:118
…

leon lishenga
- 21
- 2
2
votes
0 answers
Cannot find type __Schema in destination schema Apollo Rover and graphql-codegen schema-ast
Hello I'm trying to federate two example APIs (built using latest Apollo server) but when I try to run rover supergraph compose --config ./supergraph.yaml I get this error:
rover supergraph compose --config ./supergraph.yaml
Composing supergraph…

Jakša Mališić
- 345
- 7
- 13
2
votes
1 answer
how to use apollo federation gateway with middleware
I'm using apollo federation + typescript to implement a graphql server with subgraphs. Currently I'm working on the gateway, and I want to apply middleware to it, which will perform a token exchange functionality. The problem is that I can't get my…

Nane Petrosyan
- 553
- 1
- 7
- 19
2
votes
1 answer
Use Rover with graphql-shield
I'm using graphql-shield on a subgraph and rover-cli to generate the schema.
I've set the fallback rule to deny everything as I don't want anything to be accessible by default. But now rover-cli fails when introspecting the subgraph. I'm aware that…

LilTits
- 23
- 6
2
votes
0 answers
AWS X-Ray - Lambda invoked by another lambda does not use parent traceID
I want to use AWS X-Ray with Apollo Federation. The Apollo Gateway is hosted on AWS Lambda and it calls subservices which are also hosted on AWS Lambda.
I activated tracing for every lambda (gateway & subservices) in serverless.yml:
tracing: {
…

Nicoowr
- 770
- 1
- 10
- 29
2
votes
0 answers
How can I implement Apollo Server Federation with Kong API Gateway
I've done a lot of google searching + searching here in SO, but I still haven't found a concrete answer to this question. One person had the same question I did over on the Apollo forums but the question was never answered.
I understand how Apollo…

John Kim
- 1,081
- 10
- 26
2
votes
1 answer
NestJs Apollo GraphQL federation and responseCachePlugin
I'd like to cache my expensive GQL queries on the server-side with nestjs
I've followed https://docs.nestjs.com/graphql/plugins#using-external-plugins and then…

Christophe Blin
- 1,687
- 1
- 22
- 40
2
votes
2 answers
Apollo federation throws error: marked @external but is not defined on the base service of
i'm using apollo federation and meet with error, when trying to make something similar to computed fields (https://www.apollographql.com/docs/federation/entities/#extending-an-entity-with-computed-fields-advanced):
Error: A valid schema couldn't be…

Marcin Warzybok
- 357
- 4
- 16
2
votes
1 answer
How to avoid returning null in Apollo Federation GraphQL
I have two services (implemented using DGS Netflix) which I want to federate using apollo federation. First one is the user service which model looks something like this:
type User @key(fields: "sku") {
id: ID!
sku: Long
score:…

Zolcsak Tamas
- 147
- 1
- 8
2
votes
0 answers
Apollo Federation (Gateway): how to send different "keys" to different implementing microservices?
I am trying to compose a federated apollo service with a gateway and 3 implementing microservices.
MS1:
type Movie @key(fields: "id name") {
id: String!
name: String
}
MS2:
type Location @key(fields: "id") {
id: String!
longitude:…

ashiaka
- 3,994
- 8
- 32
- 45
2
votes
2 answers
Alternatives to @apollo/federation package
We're working on typescript microservices with REST APIs. We consider to implement GraphQL on each microservice add an API Gateway on the top level, so it will be just a single API.
At the moment we're just learning about what's possible to do, we…

mbesson
- 629
- 5
- 24