Skip to content

Can't migrate Apollo Gateway to Server v4 #7266

Answered by tiagodj
tiagodj asked this question in Q&A
Discussion options

You must be logged in to vote

I was able to find a solution! (of course after I asked the question here)

I am converting the SDL to GraphQLSchema and back again before creating the gateway:

import { buildSchema } from "graphql";
import { printSchemaWithDirectives } from "@graphql-tools/utils";

  // ...
  const fullSchema = buildSchema(supergraphSdl);
  const filteredSchema = graphqlSFilter(fullSchema);
  const filteredSdl = printSchemaWithDirectives(filteredSchema, {
    assumeValid: true,
    commentDescriptions: false,
  });

  const gateway = new ApolloGateway({
    supergraphSdl: filteredSdl,
    ...
  });

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by tiagodj
Comment options

You must be logged in to vote
9 replies
@nikhiltevaera
Comment options

@glasser
Comment options

@nikhiltevaera
Comment options

@glasser
Comment options

@nikhiltevaera
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants