You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.
# Releases
## @theguild/[email protected]
### Minor Changes
-
[#180](#180)
[`a208f1c`](a208f1c)
Thanks [@n1ru4l](https://github.com/n1ru4l)! - Add
`composeSchemaContract` function for composing schema contracts.
Running the following script:
```ts
import { composeSchemaContract } from
"@theguild/federation-composition";
import { parse } from "graphql";
const result = composeSchemaContract(
[
{
name: "a",
typeDefs: parse(/* GraphQL */ `
type Query {
a: String @tag(name: "public")
}
`),
url: "a.localhost",
},
{
name: "b",
typeDefs: parse(/* GraphQL */ `
type Query {
b: String
}
`),
url: "b.localhost",
},
],
/** Tags to include and exclude */
{
include: new Set(["public"]),
exclude: new Set(),
},
/** Exclude unreachable types */
true,
);
console.log(result.publicSdl);
```
Will result in the output containing only the fields tagged with
`public`:
```graphql
type Query {
a: String!
}
```
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
0 commit comments