Apollo Federation supergraph query gives an error

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: "failed to lookup address information: nodename nor servname provided, or not known" }))"
2022-11-10T19:20:59.880537Z apollo-router/src/plugins/include_subgraph_errors.rs:67  INFO [trace_id=dc031984b0655a46580ce9ac8c7fd6e6] apollo_router::plugins::include_subgraph_errors: redacted subgraph(locations) error
2022-11-10T19:20:59.880566Z apollo-router/src/query_planner/execution.rs:188 ERROR [trace_id=dc031984b0655a46580ce9ac8c7fd6e6] apollo_router::query_planner::execution: Fetch error: HTTP fetch failed from 'locations': HTTP fetch failed from 'redacted': redacted
  • I have both subgraph servers running and can query these individually via Apollo studio.
  • Subgraphs are published to Apollo Studio using rover cli
  • The connection string for the router is configured correctly – as I’m getting the error in the terminal

Following this tutorial – https://www.apollographql.com/tutorials/voyage-part1/referencing-an-entity

1

1 Answer
1


0

I am following the same tutorial, and ran into the same issue. Turns out apollo managed federation pings our router that is running on our local computer on port 4000 –> that indeed pings the other two services locations and reviews to resolve the requests. There is the probmem!,

We don’t have the other two subgraphs running locally on our computer, hence the router is unable to fetch as the error says

TLDR

  • make sure you startup both subgraphs by hitting yarn start or npm run start inside both sub-directories

New contributor

Ronit Panda is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



Leave a Reply

Your email address will not be published. Required fields are marked *