Skip to content
Discussion options

You must be logged in to vote

Hey @kdawgwilk!

You can use the @theguild/federation-composition library for composing the schema of a supergraph without the need of a schema registry.

Here is a small example:

import { composeSchemaContract } from '@theguild/federation-composition';

const compositionResult = composeSchemaContract(
  [
    {
      name: 'users',
      typeDefs,
    },
    {
      name: 'products',
      typeDefs,
    },
  ],
  {
    // "public" is the tag name
    include: new Set(['public']),
    exclude: new Set(),
  },
  // whether unreachable types should be stripped out.
  true,
);

if (compositionResult.errors) {
  throw new Error(
    'Could not create public GraphQL schema.\nEncountered the foll…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by n1ru4l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants