diff --git a/.changeset/nine-seals-watch.md b/.changeset/nine-seals-watch.md deleted file mode 100644 index 5389200..0000000 --- a/.changeset/nine-seals-watch.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -"@graphql-ts/schema": patch ---- - -Fixed having a union of `Arg`s where at least one is nullable without a default value not resulting in an inferred input type that includes `undefined` in the union. - -```ts -graphql.field({ - type: graphql.String, - args: { - something: graphql.arg({ - type: - Math.random() > 0.5 ? graphql.nonNull(graphql.String) : graphql.String, - }), - }, - resolve(source, { something }) { - const previouslyIncorrectlyAllowedNowError: string | null = something; - const correct: string | null | undefined = something; - return ""; - }, -}); -``` diff --git a/packages/schema/CHANGELOG.md b/packages/schema/CHANGELOG.md index 7ca5f93..354bbdc 100644 --- a/packages/schema/CHANGELOG.md +++ b/packages/schema/CHANGELOG.md @@ -1,5 +1,28 @@ # @graphql-ts/schema +## 0.5.3 + +### Patch Changes + +- [`3663690`](https://github.com/Thinkmill/graphql-ts/commit/3663690f9063c72933465a6ee369795f8d1d864e) Thanks [@mitchellhamilton](https://github.com/mitchellhamilton)! - Fixed having a union of `Arg`s where at least one is nullable without a default value not resulting in an inferred input type that includes `undefined` in the union. + + ```ts + graphql.field({ + type: graphql.String, + args: { + something: graphql.arg({ + type: + Math.random() > 0.5 ? graphql.nonNull(graphql.String) : graphql.String + }) + }, + resolve(source, { something }) { + const previouslyIncorrectlyAllowedNowError: string | null = something; + const correct: string | null | undefined = something; + return ""; + } + }); + ``` + ## 0.5.2 ### Patch Changes diff --git a/packages/schema/package.json b/packages/schema/package.json index 7e8b8fd..5d5b45c 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-ts/schema", - "version": "0.5.2", + "version": "0.5.3", "main": "dist/graphql-ts-schema.cjs.js", "module": "dist/graphql-ts-schema.esm.js", "files": [