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
1
vote
0 answers

How to write extended types from an Apollo federated schema to its database?

How are mutations handled in a federated schema? If I have an accounts service and a course service, the course service will likely extend the User type by some fields. How these fields are resolved for a query using the __resolveReference()…
1
vote
1 answer

GraphQL - Are "Federations" a Vanilla Graphql thing or an Apollo thing?

I'm having a hard time differentiating from what's vanilla GraphQL and what's Apollo. I'm trying to understand schema stitching and see that using Fragments and Federation are two different ways to do this. Found this enlightening…
garrettmac
  • 8,417
  • 3
  • 41
  • 60
1
vote
3 answers

Apollo Federation gateway and another server implementation

I am reading about apollo federation and how to migrate from schema stitching and a question came when I read: The basic strategy for migrating from a stitching gateway to Apollo Federation is to start by making the underlying services…
Stefan Yohansson
  • 657
  • 5
  • 16
0
votes
0 answers

Apollo Router request to subgraph

How can I make my apollo router make GET requests to subgraph instead of POST. Based on my benchmark, GET outperforms POST. But it only happen between client & the router. I want to improve the network performance by making GET requests from router…
apridos
  • 172
  • 4
0
votes
0 answers

Confusion in initialising GraphQL Dataloader in context

context: ({ req }) => { if (req) { return { ip: headers.userip, headers, userLanguage, decodedToken, dataLoaders: { seoDataLoader: createSeoDataLoader() } } } } Here I create a createSeoDataLoader instace for every request . now suppose if i have…
0
votes
0 answers

Cross-referencing a type with Apollo Federation across multiple sub-graphs

I am new to Apollo Federation and I am having the following issue / question: In Subgraph A I have the following: type Product @key(fields: "id") { { id: ID! title: String } In Subgraph B I have the following: type Product @key(fields: "id")…
0
votes
0 answers

File Upload on apollo gateway

I have two graphql subgraphs server a and server b. Each running fastify and mercurius and using grapqql-upload to handle files. I also have an apollo gateway connected to both servers and working well for queries and mutations. However when using…
0
votes
0 answers

NestJS + Apollo Federation Gateway Save Schema

Question When making the Apollo Gateway leveraging the NestJS GraphQL Module, how can you save the schema file? Background Normally with NestJS GraphQL support you can save the schema file with something like…
cbolles
  • 475
  • 5
  • 17
0
votes
0 answers

Apollo Router Managed Federation Random Handshake Error

I deployed Apollo Router helm chart version 1.18.0 configured with Managed Federation. I use Apollo Studio to automatically update the supergraph of Apollo Router. All subgraphs have an HTTPS url. Most requests complete successfully, but randomly we…
0
votes
0 answers

"Query.realEstateById" was defined in resolvers, but not in schema

Facing an issue with nestjs graphql schema first app. Error: "Query.realEstateById" was defined in resolvers, but not in schema. If you use the @Query() decorator with the code first approach enabled, remember to explicitly provide a return type…
Krish909
  • 77
  • 2
  • 12
0
votes
0 answers

Combining GraphQL graphs with conflicting mutation/query names in Apollo GraphQL supergraph

I'm currently working on combining two different GraphQL graphs into a single Apollo GraphQL supergraph (Apollo Federated Gateway). However, I've encountered a problem where both graphs have a getUser query and an updateUser mutation with the same…
dschu
  • 4,992
  • 5
  • 31
  • 48
0
votes
0 answers

Enable GraphQL subscriptions on Apollo Gateway server

I have a nestjs GraphQL Federation microservices app that uses federation gateway. here's the code for the gateway module; import { Module } from '@nestjs/common'; import { GraphQLModule } from '@nestjs/graphql'; import { ApolloGatewayDriver,…
saafgh
  • 33
  • 8
0
votes
0 answers

Set up Apollo-Router with TLS

I'm having some issues by setting up apollo-router 1.9.0 to work with TLS. I tried to configure apollo-router using these configs: tls: subgraph: subgraphs: spring-graphql-service: certificate_authorities:…
svx10
  • 1
0
votes
0 answers

How do I apply a graphql-middleware to my Apollo Federation?

I don’t use the managed Apollo federation instead I have a solution which looks like this: const server = new ApolloServer({ gateway: new ApolloGateway({ supergraphSdl: new IntrospectAndCompose({ subgraphs: [ // ... …
Mike
  • 613
  • 1
  • 10
  • 20
0
votes
0 answers

How can I pass headers from client to subgraph via ApolloGateway?

I am using ApolloGateway to build a federated server to federate subgraphs. I have implmeneted a data source class to set credentials on the gateway server. Below is the code: class AuthenticatedDataSource extends RemoteGraphQLDataSource { …
Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523