Tag: apollo-federation
-
Multiple canonical definitions error when using GraphQL-Mesh
0 I am trying to set up graphql-mesh federation with existing set of services that currently use schema stitching. Schemas were updated and federation was enabled in the services, and it seems to work with apollo-federation, but not with Mesh. When trying to run mesh build, I’m getting the error Multiple canonical definitions. I understand…
-
Complex type in Netflix dgs entityfetcher
0 I have defined Subgraphs to fetch data from multiple sources type MyResult{ id: ID innerResults: [InnerResult] @external otherResults: [OtherResult] @requires(fields: "innerResults") } DgsEntityFetcher looks like below @DgsEntityFetcher(name = DgsConstants.MYRESULT.TYPE_NAME) public DataFetcherResult<MyResult> getResults(Map<String, Object> values) { values.forEach((k,val) -> log.warn("key {} value{}",k,val)); return DataFetcherResult.<MyResult>newResult() .data(PlacedDeviceResult.newBuilder().Id((String)values.get("id")).innerResults((List<InnerResult>) values.get("innerResults")).build()) .build(); } But this is not working giving exception java.util.LinkedHashMap…
-
Federated Graphql in case of list of items
0 I have defined Subgraphs as below and data is fetched from multiple sources Subgraph A type Query { getAllItems(type: String!) : AllItems } type AllItems{ type: String response: QueryResponse items: [Item!]! pageInfo: Page totalCount: Int } type Item @key(fields: "id") { val1: String val2: String id: ID! } SubgraphB type Item @key(fields: "id") @extends…
-
How to merge application resolvers with dynamic resolver in NestJS using ApolloFederationDriver
0 I am developing an application that requires dynamic schema using NestJS and the Apollo GraphQL module that comes integrated with it. To achieve this, I am creating type definitions and resolvers based on user configuration. Everything works correctly when I use the ApolloDriver, but when I switch to the ApolloFederationDriver, problems arise. Let me…
-
How to query _entities in Apollo Router?
0 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 externally available Apollo Router, I get an error parsing error: cannot query field ‘_entities’ on type ‘Query’ So, internal service resolves _entities just fine, however Apollo Router return above…
-
How to check to which service is being queried by Apollo Gateway
0 I have two services in my Apollo Gateway configuration. I can only connect to one of them with a VPN. I would like to check this using the X-Forwarded-For header. public makeGateway = (): ApolloGateway => { const gateway = new ApolloGateway({ debug: this.config.DEBUG, supergraphSdl: new IntrospectAndCompose({ subgraphs: this.config.services, }), buildService: this.buildService, serviceHealthCheck: true,…
-
Apollo Federation supergraph query gives an error
2 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 error, 2022-11-10T19:20:59.880454Z apollo-router/src/services/subgraph_service.rs:173 ERROR [trace_id=dc031984b0655a46580ce9ac8c7fd6e6] apollo_router::services::subgraph_service: fetch_error="hyper::Error(Connect, ConnectError("dns error", Custom { kind: Uncategorized, error:…
-
mergeTypeDefs(allTypeDefs) does not recognize apollo federation directives @key @external
0 I have this combined typeDefs (allTypeDefs) file: ["@link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@key","@external"]) scalar Date type Name { first_name: String! middle_name: String last_name: String } type Safe @key(fields: "safe_id"){ safe_id: ID! owner: User! # HAS_SAFE wallets: [Wallet!]! } type User @key(fields: "user_id") { user_id: ID! email: String! role: String! permissions: [String!]! created_at: Date! updated_at: Date! username:…
-
Apollo Router request to subgraph
0 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 to subgraph instead of POST. federation_version: =2.0.1 subgraphs: product: method:…
-
Any other GraphQL Federation implementations apart from Apollo?
1 I have been trying to build a federation gateway on top of existing graphql services and am curious if there are any other implementations of the same apart from apollo federation? I tried to find but couldn’t find any. I am also looking for subscription on the federated gateway. Does anybody know any other…