Questions tagged [apollo-federation]

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.

https://www.apollographql.com/docs/federation/

208 questions
2
votes
1 answer

apollo gateway (federation) fails to connect to services in kubernetes environment

I have experience with graphql but its my first time trying apollo federation and kubernetes. I first tried splitting my monolith graphql server to micro services using apollo federation. It worked fine(below is the working code). Now I am trying to…
Sihoon Kim
  • 1,481
  • 2
  • 13
  • 32
2
votes
0 answers

connect My spring Boot Graphql to Apollo Gateway

I am trying to develop microservices with Spring Boot that will expose GraphQL, and connect them all to Apollo Gateway but I have the following error: UnhandledPromiseRejectionWarning: Error: Apollo Server requires either an existing schema, modules…
Omar Sallah
  • 21
  • 1
  • 3
2
votes
0 answers

Apollo-server-express implemented with Apollo federation

Has anyone succesfully implemented an apollo express server (as the gateway) together with a federation of graphQL servers? My means of authentication is present via a REST endpoint on my gateway so I am running an apollo-express server as a top…
BURGERFLIPPER101
  • 1,231
  • 4
  • 24
  • 41
2
votes
1 answer

how can I create a managed Apollo federation gateway?

I'm going nuts with this as it sounds so simple. I started from this project: https://github.com/apollographql/federation-demo Then I created an account on https://engine.apollographql.com where I registered the different federated services. I've a…
Zerzio
  • 237
  • 3
  • 11
2
votes
1 answer

Inherit interface resolvers in Apollo Federation

Is there a way to use interface resolver inheritance with Apollo Federation? I've found inheritResolversFromInterfaces: true which is an option for makeExecutableSchema. I couldn't find a way though to apply this option to a federated schema.
Daniel Hariri
  • 1,081
  • 8
  • 10
2
votes
1 answer

Merging Rest datasets in Federation with resolvers?

pretty new to GraphQL and Apollo Federation. I have a question, is it possible to populate one dataset with another such as: # in Shop Service type carId { id: Int } type Shop @key(fields: "id") { id: ID! name: String carIds: [CarId] } # in…
Nopzen
  • 566
  • 2
  • 6
  • 19
2
votes
0 answers

Apollo Federation - Entity field always returns object, not null

I'm playing with Apollo Federation, and I'm using an entity from another service (File entity), in which this entity has the following resolver: File: { __resolveReference(reference, context) { return…
Adrian
  • 1,499
  • 3
  • 19
  • 26
2
votes
1 answer

How to start apollo federation server only when all services are available

I want to start a federated apollo server: const gateway = new ApolloGateway({ serviceList: [ ... list of services ], }); const startServer = async () => { const gatewayConfig = await gateway.load(); const server = new ApolloServer({ …
pepijno
  • 236
  • 1
  • 8
1
vote
0 answers

Apollo Federation Integration testing and extended types in subgraphs

I'm currently trying to write a simple integration test to run executeOperation on one of my subgraphs. However, the graphql schema for my subraph has entity references to my other subgraphs. For Example, this block in in the .graphql for the…
1
vote
0 answers

Does NestJS execute resolvers of ObjectTypes when they are used as a fields of another ObjectType

Consider an ObjectType, as such: @ObjectType() @KeyFields('id') // wrapper to create federation directive export class MyInterestingThing { @Field(type => ID) id: string; @Field() someField: string; @Field(type => SomeDetails) …
1
vote
0 answers

How to call mutation from one subgraph to another in Apollo federation gateway GraphQL

There is 2 subgraphs User and Posts, I want to create post and add newly created post Id to the user's posts array. User and Post are different services with different databases. createPost mutation is present in Post service and addUserPost is…
Harshil Sharma
  • 101
  • 1
  • 2
  • 8
1
vote
0 answers

How can I federate custom scalar type cross subgraph via Apollo federation?

I have below graphql schema defined in a apollo server works as a subgraph behind Apollo federation router. extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable"]) scalar DateTime @shareable type…
Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523
1
vote
0 answers

Error from a non-sharable field defined in a subgraph that shoudn't have this field

I have multiple GraphQL microservices (subgraphs, using ApolloFederationDriver) with a GraphQL gateway (using ApolloGatewayDriver) I have a really strange bug since I've upgraded my GraphQL microservices and gateway to use @apollo/server…
1
vote
0 answers

GraphQL Federation Uploading File - This operation has been blocked as a potential Cross-Site Request Forgery (CSRF)

I try to upload images to Cloudflare R2 bucket. But when I upload a file on Client side, this file comes to Gateway successfully. After this step, it doesn't go to subgraph and gives this error on devtools; { "errors": [ { …
1
vote
1 answer

Is it possible to build GraphQL query where the second part of the query depends on the result of the first one?

I have a setup where I run a query on the frontend through the router (Apollo Federation Gateway) to two separate services exposing GQL endpoints - serviceA has findItems and serviceB has parseName. Now I want to run the following query in one…
Stranger95
  • 123
  • 1
  • 9