Karthik Gowda
Karthik Gowda

Reputation: 11

Can Existing Public Facing Graphql Service coexist with Graphql Federation

I am currently having a non federated graphql service which is consumed by certain clients, now there is a new requirement where I need to convert my existing non federated graphql service to federated. So my question is can I have two intstance of apollo server running one with federation and another with non federation? I don’t want to maintain two different set of repositories one for federation and another for non federation. Also my existing clients can’t move into federated services anytime soon

Upvotes: 1

Views: 64

Answers (1)

Kamil Kisiela
Kamil Kisiela

Reputation: 509

Not sure if it's possible in Apollo Server, but GraphQL Yoga can serve schema conditionally: https://the-guild.dev/graphql/yoga-server/docs/features/schema#conditional-schema

You could share /graphql endpoint for federated and non-federated schema that depends on an http header (or any property of the http request) or have two endpoints serving different schemas.

Upvotes: 0

Related Questions