I’m trying to set up federation of the same objects/schemas across a number of GraphQL endpoints.
I’ve followed the federation example in GitHub, but implemented for my use, and I’m getting the following error when trying to generate the files or run the server locally:
$ wunderctl generate
/Users/XXX/Documents/Work/OlympusDAO/treasury-subgraph/node_modules/@wundergraph/sdk/dist/definition/federation-introspection.js:46
return res.data.data._service.sdl;
^
TypeError: Cannot read properties of undefined (reading '_service')
at fetchFederationServiceSDL (/Users/XXX/Documents/Work/OlympusDAO/treasury-subgraph/node_modules/@wundergraph/sdk/dist/definition/federation-introspection.js:46:26)
We have a dashboard that currently uses multiple GraphQL endpoints: OlympusDAO
End endpoint represents a different blockchain (ethereum, arbitrum, etc).
Currently, we have a really hacky approach to fetching the GraphQL data, as the server (provided by the Graph Protocol) doesn’t support much in the way of pagination. I was hoping to aggregate the results using Wundergraph and provide a simple endpoint for the React frontend to fetch data from.
query {
countries: test_country(code:"DE") {
code
name
}
test:test_getCityByName(config:{lang:en, units:imperial}, country:"DE", name:"Berlin") {
id
country
name
}
}
And we receive the correct results. Could you please share with us the resulting schema from .wundergraph/generated/wundergraph.schema.graphql - That would help us determine the problem better. Thanks!