Apollo Federation compatibility

I could have sworn that someone mentioned at some point that Apollo Federation compatibility was being considered. Perhaps that was in slack?

To be clear, you technically can, but it involves delegating the entire schema into another server, which is wasteful.

I didn’t see any new news on Slack, and nothing here, so I thought I would post it.

Why it doesn’t work

Apollo says:

Federated services will need to implement the following additions to the schema to allow the gateway to use the service for execution:

scalar _Any
scalar _FieldSet

# a union of all types that use the @key directive
union _Entity

type _Service {
  sdl: String
}

extend type Query {
  _entities(representations: [_Any!]!): [_Entity]!
  _service: _Service!
}

directive @external on FIELD_DEFINITION
directive @requires(fields: _FieldSet!) on FIELD_DEFINITION
directive @provides(fields: _FieldSet!) on FIELD_DEFINITION
directive @key(fields: _FieldSet!) on OBJECT | INTERFACE

# this is an optional directive discussed below
directive @extends on OBJECT | INTERFACE

Fauna does not permit any types that start with _, unions, and I am pretty sure custom directives.

workarounds

Schema delegating works fine and Schema Stitching, too. But Schema Stitching is deprecated in favor of Federation.

You can also create your own GraphQL server from scratch and provide resolvers for everything to make it Federation compatible.

Apollo Federation was (and still is) being considered. Unfortunately, other priorities have pushed that work back. I can’t promise that we’ll ever support Apollo Federation, but we haven’t abandoned the idea.