Separating public/private schema

Hi,

I am considering using GraphQL to define a new set of APIs, and I am wondering how to best separate private from public API using apollo server.
The idea is to have a public schema and a private that extends the public one. Ideally, I would like a single server that exposes two endpoints:

  1. /graphql/public with only the public schema
  2. /graphql/private with public+private schema

I looked into federation, but it seems to require multiple servers. Also it does not support subscriptions.

Is there an easier/better way for me to achieve the above?

Any input or pointers to other sources would be greatly appreciated.

Thank you in advance.

Alex

1 Like

Hi Alex,

I’m running into a similar dilemma, where I’d like to expose certain parts of my private api to the public. I’m wondering if you came up with a solution?

Best,
Sam