Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions .changeset/1purple-beers-mate.md

This file was deleted.

26 changes: 0 additions & 26 deletions .changeset/2afraid-geckos-bow.md

This file was deleted.

30 changes: 0 additions & 30 deletions .changeset/3new-laws-cough.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/4pretty-knives-rule.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/brown-buses-look.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/eight-monkeys-protect.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/red-radios-sniff.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/silly-eyes-rhyme.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/sour-papayas-cough.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tough-apples-sniff.md

This file was deleted.

67 changes: 0 additions & 67 deletions .changeset/zafraid-colts-jam.md

This file was deleted.

76 changes: 76 additions & 0 deletions packages/extend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,81 @@
# @graphql-ts/extend

## 2.0.0

### Major Changes

- [#31](https://github.com/Thinkmill/graphql-ts/pull/31) [`5d2341e2d4653f8370c05f0e07ba9a151bf6b085`](https://github.com/Thinkmill/graphql-ts/commit/5d2341e2d4653f8370c05f0e07ba9a151bf6b085) Thanks [@emmatown](https://github.com/emmatown)! - `graphql@15` is no longer supported. `[email protected]` or newer is now required.

- [#31](https://github.com/Thinkmill/graphql-ts/pull/31) [`5d2341e2d4653f8370c05f0e07ba9a151bf6b085`](https://github.com/Thinkmill/graphql-ts/commit/5d2341e2d4653f8370c05f0e07ba9a151bf6b085) Thanks [@emmatown](https://github.com/emmatown)! - The `wrap` export has been removed. Since the types in `@graphql-ts/[email protected]` are compatible with the GraphQL.js types directly, these functions are no longer needed.

- [#51](https://github.com/Thinkmill/graphql-ts/pull/51) [`8169eb85cdfc22f1f9730fca9136bd44e057af81`](https://github.com/Thinkmill/graphql-ts/commit/8169eb85cdfc22f1f9730fca9136bd44e057af81) Thanks [@emmatown](https://github.com/emmatown)! - The `Key` type parameter on `Field` has been replaced with a new type parameter (`SourceAtKey`) and represents essentially `Source[Key]` instead of `Key`. For example, a field like this can be written:

```ts
const field = g.field({
type: g.String,
});
```

and `field` will be usable like this:

```ts
const Something = g.object<{
name: string
}>({
name: "Something"
fields: {
name: field,
// @ts-expect-error
other: field
},
});
```

The field is usable at `name` since the source type has an object with a `name` property that's a `string` but using it at `other` will result in a type error since the source type doesn't have a `other` property.

Previously, using `g.field` outside a `g.object`/`g.fields` call would require specifying a resolver and fields written within `g.fields` would be bound to be used at a specific key rather than the new behaviour of any key with the right type.

This also reduces the need for `g.fields`. For example, the example given in the previous JSDoc for `g.fields`:

```ts
const nodeFields = g.fields<{ id: string }>()({
id: g.field({ type: g.ID }),
});
const Node = g.interface<{ id: string }>()({
name: "Node",
fields: nodeFields,
});
const Person = g.object<{
__typename: "Person";
id: string;
name: string;
}>()({
name: "Person",
interfaces: [Node],
fields: {
...nodeFields,
name: g.field({ type: g.String }),
},
});
```

Now the `g.fields` call is unnecessary and writing `nodeFields` will no longer error at the `g.field` call and will instead work as expected.

```ts
const nodeFields = {
id: g.field({ type: g.ID }),
};
```

There is still some use to `g.fields` for when you want to define a number of shared fields with resolvers and specify the source type just once in the `g.fields` call rathe than in every resolver.

This change is unlikely to break existing code except where you explicitly use the `Field` type or explicitly pass type parameters to `g.field` (the latter of which you likely shouldn't do) but since it changes the meaning of a type parameter of `Field`, it's regarded as a breaking change.

### Patch Changes

- Updated dependencies [[`8169eb85cdfc22f1f9730fca9136bd44e057af81`](https://github.com/Thinkmill/graphql-ts/commit/8169eb85cdfc22f1f9730fca9136bd44e057af81), [`8169eb85cdfc22f1f9730fca9136bd44e057af81`](https://github.com/Thinkmill/graphql-ts/commit/8169eb85cdfc22f1f9730fca9136bd44e057af81), [`8169eb85cdfc22f1f9730fca9136bd44e057af81`](https://github.com/Thinkmill/graphql-ts/commit/8169eb85cdfc22f1f9730fca9136bd44e057af81), [`8169eb85cdfc22f1f9730fca9136bd44e057af81`](https://github.com/Thinkmill/graphql-ts/commit/8169eb85cdfc22f1f9730fca9136bd44e057af81), [`5d2341e2d4653f8370c05f0e07ba9a151bf6b085`](https://github.com/Thinkmill/graphql-ts/commit/5d2341e2d4653f8370c05f0e07ba9a151bf6b085), [`d7151bd2a6333327ac1a57e0c924bd4bfdbdf01f`](https://github.com/Thinkmill/graphql-ts/commit/d7151bd2a6333327ac1a57e0c924bd4bfdbdf01f), [`5d2341e2d4653f8370c05f0e07ba9a151bf6b085`](https://github.com/Thinkmill/graphql-ts/commit/5d2341e2d4653f8370c05f0e07ba9a151bf6b085), [`5d2341e2d4653f8370c05f0e07ba9a151bf6b085`](https://github.com/Thinkmill/graphql-ts/commit/5d2341e2d4653f8370c05f0e07ba9a151bf6b085), [`5d2341e2d4653f8370c05f0e07ba9a151bf6b085`](https://github.com/Thinkmill/graphql-ts/commit/5d2341e2d4653f8370c05f0e07ba9a151bf6b085), [`8169eb85cdfc22f1f9730fca9136bd44e057af81`](https://github.com/Thinkmill/graphql-ts/commit/8169eb85cdfc22f1f9730fca9136bd44e057af81)]:
- @graphql-ts/[email protected]

## 1.0.3

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/extend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-ts/extend",
"version": "1.0.3",
"version": "2.0.0",
"description": "Utilities to extend existing GraphQL schemas with @graphql-ts/schema",
"main": "dist/graphql-ts-extend.cjs.js",
"module": "dist/graphql-ts-extend.esm.js",
Expand All @@ -18,7 +18,7 @@
],
"license": "MIT",
"peerDependencies": {
"@graphql-ts/schema": "^0.6.0",
"@graphql-ts/schema": "^1.0.0",
"graphql": "16"
},
"devDependencies": {
Expand Down
Loading