204 questions
0
votes
1
answer
12
views
How can I aggregate fields using a custom directive in Federated GraphQL at the gateway layer?
I have cross-cutting concern across my graph, where I need to aggregate fields at my gateway layer, versus at my subgraphs. I must tag fields of interest in all of my subgraphs with a custom directive ...
0
votes
1
answer
43
views
How to Build a Python-Based GraphQL API Gateway and Federation Service for Django Microservices?
I have a set of Django microservices, each exposing GraphQL APIs. Currently, I'm using Apollo Server with Apollo Federation to combine all subgraphs into a single supergraph. However, I've encountered ...
0
votes
0
answers
51
views
Strawberry GraphQL Federation: TypeError: Cannot convert value to AST: ['id']
Full disclosure: first time Strawberry user, new to Python, but not new to GraphQL and federation.
I followed https://strawberry.rocks/docs/guides/federation with Vendor and Product as classes instead ...
0
votes
1
answer
23
views
How to get zone-specific stock information for materials?
Problem Description:
I'm working with a federated GraphQL setup involving three services: Material, Zone, and Stock. Each service has its own type definitions:
Zone Service:
Extends the Material ...
0
votes
1
answer
22
views
expected value of type "_Any" in apollo federation
{
"representations": [
{
"__typename": "dummy",
"templateId": "X",
"strategy": "dummy",
"...
0
votes
0
answers
113
views
NestJS GraphQL Federation 2, problem with @ResolveReference between two services
I need help.
I currently have nestjs graphql microservices (apollo) federated via a nestjs gateway (appollo gateway).
The types are shared between the services via a library that shares the types (I'm ...
1
vote
0
answers
35
views
Inability to Use transformSchema and Custom Directives in Apollo Gateway Configuration with @nestjs/graphql #3296
Current behavior
The issue manifests when attempting to use the transformSchema and publicDirectiveTransformer in the Apollo Gateway configuration within a NestJS application using the code-first ...
0
votes
0
answers
76
views
Apollo Gateway doesn't connect to other services inside Docker
I am running 2 GrapQL APIs inside my project and have a Apollo Gateway that connects them. When I run the docker compose file, the APIs get built and work (I can access them through the browser) but ...
2
votes
0
answers
129
views
GraphQL Federation for conditional dependencies
Suppose I have 3 datapoints in 3 separate subgraphs
Data Point A in "Subgraph 1"
Data Point B in "Subgraph 2"
Data Point C in "Subgraph 3"
A depends on B and C ...
0
votes
0
answers
54
views
Extending a type in GraphQL / Apollo Federation
What
I'm trying to extend another type using GraphQL federation under using the following syntax:
[Key("id")]
[Extends]
public class Parent
{
[ID]
public string Id { get; set; }
...
0
votes
0
answers
22
views
Graphql Federation composition errors
I am having weird composition errors , composing 3 different subgraphs with apollo federation v2. Subgraph 3 is what i am trying to run with nestjs and getting different errors with different versions ...
0
votes
1
answer
65
views
Centralized Authorization in Graphql Federation
I'm looking for an approach to centralize authorization in my Graphql setup.
here is the full context of the problem I'm facing
i have one supergraph, and two subgraphs, let's call them posts, and ...
1
vote
0
answers
255
views
I Got ERROR : Cannot query field \"queryName\" on type \"Query\".", Even if it is published in schema
In my project I am using ApolloStudio for publishing my graphql queries,
Using rover script I published my new query and it reflected in the changeLogs also in the API schema. But when I tried it on ...
0
votes
0
answers
58
views
Is there any way to use Apollo Federation with HotChocolate to make one to many relationships between entities located in different services?
I have PostService and UserService in two different web applications written on c# web api. There is also an Apollo api gateway.
const gateway = new ApolloGateway({
serviceList: [
{ name: '...
0
votes
0
answers
126
views
Apollo gateway error formatting with NestJS
I have GraphQL services (apollo) made with NestJS federated by apollo gateway.
My services return a formatted graphql error, I add an internal error code and some other information in the extensions. ...
0
votes
1
answer
38
views
owned types are marked as extension [is an extension type, but there is no type definition for]
I am trying to run MOST MINIMALISTIC gateway but I am running into false positive error when one of the dependencies is thinking that Use Objet type is "extension" type.
Error: A valid ...
0
votes
0
answers
10
views
Apollo Server Graphql resolve dependent property in mutation
I have a user subgraph and post subgraph. There are mutations on the post subgraph that need user details from the user type. Is there a way to resolve the dependent fields in a mutation ?
type User{
...
0
votes
1
answer
308
views
How to resolve values from other subgraphs deep in a nested query in Apollo?
Let's say I have the following federated graph:
type Query {
products: [Product]!
}
// resolved by `discounts-service`
type Discount {
priceWithDiscount: Float
expired: Boolean
}
// ...
0
votes
0
answers
82
views
How to lookahead from a reference resolver in GraphQL Ruby?
Using lookahead in GraphQL Ruby is really helpful to optimize your database queries, but it seems like you can only use it at the field level. This is fine for normal GraphQL API, but when using ...
1
vote
0
answers
35
views
Mixing Apollo v3 and v4 GraphQL in a federated graph
We have a mixture of Apollo v2 and Apollo v3 services running right now, and federation is working very well amongst them. We're about to start upgrading services to Apollo v4. There have been a ...
0
votes
0
answers
304
views
How to Use @defer Directive in GraphQL Federated Application with NestJS
I am working on a GraphQL federated application using NestJS, and I'm trying to implement the @defer directive to enable partial query execution and improve the performance of my GraphQL API. However, ...
0
votes
0
answers
193
views
Nestjs Graphql Federation 2 problem when migrating from @apollo/gateway to @apollo/router
I'm facing errors using Rover CLI to compose my subgraphs, however I don't face any issues with the gateway approach using the same code.
I'm using Nestjs graphql driver.
It has been a blocker for a ...
0
votes
0
answers
199
views
Apollo Graph QL - Router fails to start - Voyage II: Federating the Monolith
I am working on the course Voyage II: Federating the Monolith
https://www.apollographql.com/tutorials/voyage-part2/05-configuring-the-router
I have progressed along tot he point where we need to ...
0
votes
1
answer
114
views
Apollo federation with graphql java kickstart giving runtime error while executing query
I have couple of existing backend services exporting graphql data for 'accounts' & 'billing'. These services have implemented graphql using graphql-java-kickstart (without springboot). I want to ...
0
votes
0
answers
48
views
Changing Keys of a subgraph in apollo federation
I have two subgraphs that contribute to a supergraph by following apollo federation 2.0. One of the subgraph defines a type Payment which has a field bill. The subgraph that defines the Payment type ...
0
votes
0
answers
85
views
Spring Graphql Resolvers
Is there a way in graphql to only return a result record in an list if the key is found in 2 resolvers.
For example:
Query {
getData:[A!]!
}
Service A resolver
type A @key(fields: "id") {...
1
vote
1
answer
437
views
Graphql Inner and Left Join
We are using Apollo Router + Netflix DGS to build federated graphql services. Suppose that we have a common relational database right now for books and authors, but want to move towards a microservice ...
1
vote
0
answers
147
views
Importing "@authenticated" directive using nestjs, apollo, and code-first approach
I am using NestJS server with microservices and Apollo Router.
I want to add "@authenticated" directive to my resolvers so I can omit authentication on requests to routes that do not require ...
0
votes
1
answer
93
views
Add appsync as subgraph to apollo graphql supergraph
I have apollo supergraph created with two subgraphs working perfectly. I have used Rover commands to join subgraphs with supergraph.
Now I'm trying to add appsync as a subgraph to my supergraph. I ...
1
vote
0
answers
286
views
Complex type in Netflix dgs entityfetcher
I have defined Subgraphs to fetch data from multiple sources
type MyResult{
id: ID
innerResults: [InnerResult] @external
otherResults: [OtherResult] @requires(fields: "innerResults")
}
...
1
vote
0
answers
205
views
How to query _entities in Apollo Router?
While resolving GraphQL request, Apollo Router makes requests that include field _entities(representations: $representations) to internal services.
However, when trying to issue the same query to ...
0
votes
2
answers
179
views
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 ...
0
votes
0
answers
177
views
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 ...
2
votes
0
answers
285
views
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 ...
2
votes
0
answers
200
views
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 ...
1
vote
0
answers
297
views
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()
...
1
vote
0
answers
115
views
Is there a way to load pre-federated schema by using Apollo Gateway?
I am using ApolloGateway to federate graphql subgraphs. Below is the demo code:
const gateway = new ApolloGateway({
supergraphSdl: new IntrospectAndCompose({
subgraphs: [
{ name: 'accounts'...
0
votes
1
answer
263
views
How to set different header for different subgraph via ApolloGateway?
I am using Apollo gateway to build a graphql federation service. Below is the demo code:
const gateway = new ApolloGateway({
supergraphSdl: new IntrospectAndCompose({
subgraphs: [
{ name: '...
1
vote
1
answer
328
views
Set-cookie headers are not being sent when calls are made through apollo federation gateway NestJs
I have a non monorepo nestJs graphql microservices app, and opted for Apollo federation gateway. I have an authentication server which works fine and sets cookies to header, only problem is when calls ...
1
vote
0
answers
361
views
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 ...
3
votes
1
answer
342
views
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: [&...
0
votes
2
answers
314
views
Apollo gateway gives an error when `@requires` fieldset has an entity which is resolved by two separate clients
I have 4 subgraph services namely products, couriers, cargo_service, tax. (Not a real-world example, just playing with graphql federation concepts).
Below is my code for those services.
products ...
0
votes
0
answers
49
views
Is the Apollo Federation loosely coupling?
I am pretty new to microservices architecture and Apollo Federation. I am curious: is the Apollo federation really loosely coupled? Because if a subgraph doesn't work in Node.js, the gateway also ...
0
votes
0
answers
163
views
Union of responses from two different subgraphs
I was looking into apollo federation but was not able to deduce from a first scan of their docs if I will be able to respond from the router with union of responses from two different subgraphs.
For ...
1
vote
1
answer
998
views
GraphQL - Apollo printSchema error: TypeError: Cannot read properties of undefined (reading 'kind')
I am trying to use the printSchema function from Apollo to include @directives in the GQL Schema.
However it keeps showing this error:
TypeError: Cannot read properties of undefined (reading 'kind')
...
2
votes
0
answers
65
views
How do you order by a left join with graphql apollo federaton?
I'm using apollo federation. I need to order owners by if they written a product review for a particular product, and then the ones that haven't last.
In psql world it's really simple
select * from ...
5
votes
1
answer
3k
views
How to resolve type from another subgraph in a Apollo GraphQL federated schema?
I have an Order subgraph and a Menu subgraph. The order subgraph returns customers orders and the Menu subgraph return information about menu's and the menu items.
When I fetch an order, I want the ...
1
vote
1
answer
244
views
how to use neo4j/graphql in conjunction with nestjs-neo4j to access the neo4j schema directives
I am using:
nestjs v9
neo4j v4.5
neo4j/graphql v3
apollo server v4 w/federation
neo4jService from nestjs-neo4j
to create a neo4jGraphqlService that uses neo4jService for most neo4j DB ...
1
vote
2
answers
2k
views
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 ...
2
votes
0
answers
2k
views
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 ...