Skip to content

Commit 8593e38

Browse files
Upcoming Release Changes (#181)
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>
1 parent a208f1c commit 8593e38

File tree

3 files changed

+54
-53
lines changed

3 files changed

+54
-53
lines changed

.changeset/plenty-foxes-guess.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,58 @@
11
# @theguild/federation-composition
22

3+
## 0.20.0
4+
5+
### Minor Changes
6+
7+
- [#180](https://github.com/graphql-hive/federation-composition/pull/180) [`a208f1c`](https://github.com/graphql-hive/federation-composition/commit/a208f1cd72bb8bff2a350d0e14284c1a00644225) Thanks [@n1ru4l](https://github.com/n1ru4l)! - Add `composeSchemaContract` function for composing schema contracts.
8+
9+
Running the following script:
10+
11+
```ts
12+
import { composeSchemaContract } from "@theguild/federation-composition";
13+
import { parse } from "graphql";
14+
15+
const result = composeSchemaContract(
16+
[
17+
{
18+
name: "a",
19+
typeDefs: parse(/* GraphQL */ `
20+
type Query {
21+
a: String @tag(name: "public")
22+
}
23+
`),
24+
url: "a.localhost",
25+
},
26+
{
27+
name: "b",
28+
typeDefs: parse(/* GraphQL */ `
29+
type Query {
30+
b: String
31+
}
32+
`),
33+
url: "b.localhost",
34+
},
35+
],
36+
/** Tags to include and exclude */
37+
{
38+
include: new Set(["public"]),
39+
exclude: new Set(),
40+
},
41+
/** Exclude unreachable types */
42+
true,
43+
);
44+
45+
console.log(result.publicSdl);
46+
```
47+
48+
Will result in the output containing only the fields tagged with `public`:
49+
50+
```graphql
51+
type Query {
52+
a: String!
53+
}
54+
```
55+
356
## 0.19.1
457

558
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@theguild/federation-composition",
3-
"version": "0.19.1",
3+
"version": "0.20.0",
44
"type": "module",
55
"description": "Open Source Composition library for Apollo Federation",
66
"repository": {

0 commit comments

Comments
 (0)