-
-
Notifications
You must be signed in to change notification settings - Fork 179
Open
Description
Federation schema
In order for the queries to merge properly with fastify and mercurius gateway it's better to add in each subschema :
import SchemaBuilder from '@pothos/core';
import DirectivesPlugin from '@pothos/plugin-directives';
import FederationPlugin from '@pothos/plugin-federation';
const builder = new SchemaBuilder<{
DefaultFieldNullability: true;
FederationPolicies: 'user:policy';
}>({
plugins: [DirectivesPlugin, FederationPlugin],
directives: {
useGraphQLToolsUnorderedDirectives: true,
},
});
builder.queryType({
directives: {
extends: true,
},
});
export const schema = builder.toSubGraphSchema({
linkUrl: 'https://specs.apollo.dev/federation/v2.5',
federationDirectives: ['@extends'],
});
With this on, schemas will merge perfectly on the gateway endpoint.
Shouldn't it be great to have it documented or put in the example ?
Metadata
Metadata
Assignees
Labels
No labels