Skip to content

Releases: typed-graphql-builder/typed-graphql-builder

v4.0.0

13 May 19:59
Compare
Choose a tag to compare

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

20 Apr 17:55
2be2701
Compare
Choose a tag to compare

3.5.1 (2023-04-20)

Bug Fixes

v3.5.0

07 Mar 21:35
6c5e43a
Compare
Choose a tag to compare

v3.4.0

08 Feb 16:38
4b1ad4d
Compare
Choose a tag to compare

3.4.0 (2023-02-08)

Features

  • improve unions and interfaces support (#48) (4b1ad4d)

v3.3.0

01 Nov 19:19
Compare
Choose a tag to compare

3.3.0 (2022-11-01)

Features