Releases: typed-graphql-builder/typed-graphql-builder
v4.1.5
v4.1.4
v4.1.3
v4.1.2
v4.1.1
v4.1.0
v4.0.0
4.0.0 (2023-05-13)
Bug Fixes
BREAKING CHANGES
- Fixes the behavior of non-primitive scalars.
After this PR, non-primitive scalars will only be allowed if:
- they are nullable and the user is sending a null value, or
- the value is sent within a variable
By using a branded type for scalars, we can precisely control the
allowed input types:
- Scalars that are primitives (strings or numbers) can be passed inline
- null or undefined values for scalars can also be passed directly
- All other scalars must be passed as variables
Despite using a branded type, the user shouldn't observe any of the
branding:
-
Scalars are unwrapped when determining allowed user inputs (both
variables and primitives) -
Scalars are unwrapped when showing output types
-
Some queries that involved scalars will no longer be valid
-
Exported input types are no longer directly usable as they may contain
CustomScalar branding wrappers. If upgrading, you can use the
UnwrapCustomScalars<T>
generic to replace custom scalars with their
actual types in input types.
Before
import { MyInputObjectType } from './api.ts'
After
import { MyInputObjectType as MyInputObjectTypeWrapped, UnwrapCustomScalars} from './api.ts'
type MyInputObjectType = UnwrapCustomScalars<MyInputObjectType>
Some scalars don't need the wrapper. The script makes some effort to
auto-detect whether the scalar can be passed inline or not, and if it
was specified as --scalar ScalarName=string
or --scalar ScalarName=number
it will allow it. Branded primitives will
unfortunately be wrapped.
v3.5.1
v3.5.0
3.5.0 (2023-03-07)
Features
- simplify input and output types (#49) (6c5e43a), closes /github.com/koskimas/kysely/blob/a8e28d9edd6284d5410f93bc24d3c6252add6ea1/src/util/type-utils.ts#L141