Questions tagged [graphql-federation]

21 questions
7
votes
0 answers

cannot POST /graphql (404) error when running e2e test in jest (GraphQL Federation)

I am trying to test my graphql service end to end using supertest + jest in a Nest.js application but keep getting this error: Error: cannot POST /graphql (404) I have tried many things but couldn't get the test to run completely due to that…
6
votes
0 answers

nestjs + apollo graphql federated gateway can't introspect services because of "bad request", reproducible git repository available

In an NX monorepo I'm building 3 nestjs application, an auth-service + user-service and a gateway to start off with. They're all powered by apollo graphql and following the official nestjs documentation. The issue that I'm having is that with both…
3
votes
1 answer

Graphql federation vs schema stitching. When to pick one over the other

I'm new to both concepts so excuse me if it's opinion-based. Currently, I'm looking at Apollo Federation and schema stitching provided by the graphql-tools package, though I guess it applies to similar packages. Could something like a table be…
ZenVentzi
  • 3,945
  • 3
  • 33
  • 48
2
votes
3 answers

Apollo Server Federation with graphql-shield

I'm using graphql-shield to protect a subgraph. const isAuthenticated = rule({ cache: 'contextual' })(async (parent, args, ctx, info) => { return ctx.isAuthenticated }) const permissions = shield({ Query: { '*': and(isAuthenticated) }, …
capiono
  • 2,875
  • 10
  • 40
  • 76
1
vote
0 answers

query result composition problem in graphQL gateway

so we have a microservice architecture and there was a need for queries of different types from different microservices. so we implemented the graphQL gateway and it works and it is really good. but there was this peculiar need that is just driving…
jcob82
  • 51
  • 7
1
vote
1 answer

How can a graphql subgraph forward query to another subgraph

There is a graphql api in a subgraph owned by another team type Query { user: UserInfo } Our team wants to create a new graphql api in our subgraph that return the same data type as a proxy. type Query { specialUser(encryptedUserId: ID):…
FrankGod
  • 91
  • 7
1
vote
0 answers

GraphQL Federation: Is it possible to have multiple service contribute to a list/array result?

Assuming I have the following GraphQL schema defined: type Widgets { id: ID! name: String! } type Basket { id: ID! widgets: [Widgets]! } And that I have a widget service that provides those results. But now I have a new service "NEW…
chadgh
  • 9,063
  • 8
  • 38
  • 54
1
vote
0 answers

Graphql Federation: JS Testing Framwork

I am looking for JS testing framework or some solution to test GraphQL Federation implimentation. My Current Implementation is in Apollo Server, Gateway, and subgraph. I want to test federated queries, where multiple subgraphs are involved. is there…
1
vote
1 answer

Field can only be defined once graphql

I have 2 subgraphs I have this code in the subgraph for template and fileserver I call buildFederatedSchema 2 time since I have 2 subgraphs in the server list this the code in modified buildFederatedSchema gives me this error what should I do?
1
vote
1 answer

GraphQL Playground bootloop (Nestjs)

I am trying to use the GQL Playground. I've join a team that has never used it up until now, and whenever I hit http://localhost:8001/graphql , I can see the GQL Playground loading logo, but it's bootlooping. I can see they are using GQL Federation…
A Mehmeto
  • 1,594
  • 3
  • 22
  • 37
1
vote
1 answer

GraphQL Federation: How To Consume, Not Extend

I have a service that returns Products that I can extend via GraphQL Federation in a service returning Reviews. The review service depends on the Products and this decoupling is just awesome! I also have an order service that stores (among other…
rü-
  • 2,129
  • 17
  • 37
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…
0
votes
1 answer

Context in GraphQL Apollo server running infinitely

I want header values in GraphQl Apollo server in NodeJS and for this I used context function in it, but it is running infinite times. It is printing "abcd" infinitely in console. console: code: const server = new ApolloServer({ schema:…
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:…
0
votes
0 answers

Configure Graphql federation with nest js

I created a aws lambda severless graphQL api using prisma and type-graphql library. Now I want to connect that aws microservices with graphql federation. But all documentations are related to microservices implement using nest js.Can anyone give a…
1
2