question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Apollo Gateway engineConfig for managed federation

See original GitHub issue

Hi. I have been using Apollo Gateway with managed federation for quite some time now and it used to work very well, but recently, I noticed an error in the gateway like this after upgrading dependencies:

Screenshot from 2020-04-14 15-35-37

Error checking for changes to service definitions: When serviceListis not set, an Apollo Engine configuration must be provided. See https://www.apollographql.com/docs/apollo-server/federation/managed-federation/ for more information. WhenserviceList is not set, an Apollo Engine configuration must be provided. See https://www.apollographql.com/docs/apollo-server/federation/managed-federation/ for more information.

Which did not come before. Since it is a managed federation, I don’t have a serviceList and this is how I used to initialize my ApolloGateway:

import { ApolloGateway, RemoteGraphQLDataSource } from '@apollo/gateway';
const gateway = new ApolloGateway({
        buildService(service) {
            return new RemoteGraphQLDataSource({
                url: service.url,
                willSendRequest: ({ request, context }) => {
                    request.http.headers.set('authorization', context.token);
                }
            });
        },
        debug: false
    });

const server = new ApolloServer({
        gateway,
        subscriptions: false,
        introspection: true,
        playground: {
            endpoint: config.apollo.playgroundEndpoint
        },
        engine: {
            apiKey: process.env.ENGINE_API_KEY,
            schemaTag: process.env.SCHEMA_TAG
        },
        context: async ({ req }) => {
            // Some code here....
            // Return variables
            return {variables};
        }
    });

May I know what changed I have to make? Looks like there are some new parameters but I don’t find any documentation related to that.

For eg. I am not sure what to give in federationVersion which is a property of ManagedConfig as per this commit: https://github.com/apollographql/apollo-server/commit/f6ba2dea9b4f7c8aa602cad66398685d8bdbc3a2#diff-7b5e66976a637efc823826a985fa8e65

Thanks.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
abernixcommented, Apr 14, 2020

This has been promoted to latest.

1reaction
abernixcommented, Apr 14, 2020

Thanks for reporting it! I’ll promote this to latest in a couple hours.

Read more comments on GitHub >

github_iconTop Results From Across the Web

apollo-server-core - UNPKG
The CDN for apollo-server-core. ... 172, /** @deprecated: This is undefined for servers operating as gateways, ... To set up managed federation, see',....
Read more >
Tutorial: How to build a GraphQL server
Apollo Engine: A GraphQL gateway that provides caching, error tracking, and performance tracing. This is a tutorial for the second and third ...
Read more >
Apollo Server timeout while waiting for stream data
My calls were lasting a bit over 30 seconds and the default timeout was returning 503s as well so I increased that. Assuming...
Read more >
Lunar Outpost - Springer Link
Even as the Apollo 17 astronauts returned from the Moon in. 1972, the Nixon Administration was closing the hatch on missions beyond low...
Read more >
Untitled
Portal da nota fscal eletronica, Burc dogum gunleri, Dalbeattie 7 stanes review ... Adf managed bean lifecycle, News australia melbourne, Sega master system ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found