Releases: 0no-co/gql.tada
Releases · 0no-co/gql.tada
@gql.tada/[email protected]
Patch Changes
- Add
generate-schema
command which takes a URL | path to a JSON file and outputs a graphql schema. Example:gql-tada generate-schema https://example.com ./schema.graphql --header 'authorization: bearer token'
Submitted by @JoviDeCroock (See #120)
[email protected]
[email protected]
Minor Changes
- Add CLI entrypoint
gql-tada
capable of generating the types file without the LSP running
Submitted by @JoviDeCroock (See #58) - Add
graphql.persisted()
to create an API for persisted documents that omits a query’s definitions from the output bundle
Submitted by @kitten (See #98)
Patch Changes
- Allow
graphql.scalar
to resolve types for input objects
Submitted by @kitten (See #97) - Address performance cliff for
getDocumentNode
inference and object-flattening utilities
Submitted by @kitten (See #107) - Refactor type unwrapping for
NON_NULL
field types (with@_optional
and@_required
), input types, and variable types
Submitted by @kitten (See #104) ⚠️ Fix$tada
not being exported, which can cause projects withisolatedModules: true
set from building
Submitted by @kitten (See #99)⚠️ Fix schema pathname resolution in CLI
Submitted by @wyattades (See #82)- Add
disableMasking
flag to allow fragment masking to be disabled. When this is set totrue
on thesetupSchema
interface, fragments won’t be masked, which imitates the behaviour you’d see when adding@_unmask
to every single one of your fragments. This is currently considered a preview feature
Submitted by @kitten (See #69) - Keep the possible types that are iterated through narrow through repeated abstract type fragment spreads, and provide an optional
__typename?: PossibleType
field by default so the type checker has an exact property to merge types on
Submitted by @kitten (See #102) - Handle inference of input object fields with missing
defaultValue
properties in introspection
Submitted by @llllvvuu (See #101) - Add missing support for input object fields with default values. Previously, input object fields with default values were still marked as required in variables
Submitted by @kitten (See #73) - Refactor several internal utility types
Submitted by @kitten (See #68) - Updated dependencies (See #58)
- @gql.tada/[email protected]
@gql.tada/[email protected]
Minor Changes
- Add CLI entrypoint
gql-tada
capable of generating the types file without the LSP running
Submitted by @JoviDeCroock (See #58)
[email protected]
[email protected]
Minor Changes
- Add
maskFragments
to cast data to fragment masks of a given set of fragments
Submitted by @kitten (See #43) - Add
graphql.scalar()
utility to retrieve or type check the type of scalars and enums
Submitted by @kitten (See #45) - Add
unsafe_readResult
to unsafely cast data to the result data of a given document
Submitted by @kitten (See #43)
Patch Changes
[email protected]
Minor Changes
- Support
@_optional
and@_required
directives on fields overriding the field types.
When used,@_required
can turn a nullable type into a non-nullable, and@_optional
can turn non-nullable fields into nullable ones. (See “Client-Controlled Nullability” in Graphcache for an example of a client implementing this.)
Submitted by @kitten (See #32) - Add support for
@_unmask
directive on fragments causing the fragment type to not be masked.FragmentOf<>
will return the full result type of fragments when they’re annotated with@_unmask
and spreading these unmasked fragments into parent documents will use their full type
Submitted by @kitten (See #31)
Patch Changes
- Format
TadaDocumentNode
output’s third generic differently. The output of fragment definitions will now be more readable (e.g.{ fragment: 'Name', on: 'Type', masked: true }
)
Submitted by @kitten (See #31) - Improve performance of selection and variables inference
Submitted by @kitten (See #35) - Improve performance of GraphQL document parser
Submitted by @kitten (See #34)
[email protected]
Patch Changes
- Prevent type inference for schemas with “huge” root types (i.e. types with an excessive amount of fields) from failing introspection mapping
Submitted by @kitten (See #25) - Remove redundant constraint on
IntrospectionQuery
data. When the full type is used as anextends
, the input type (which can be a huge schema), is checked against this type, which forces a full evaluation. This means that TypeScript may spend multiple seconds inrecursiveTypeRelatedTo
. This work has been eliminated and should help performance
Submitted by @kitten (See #26)
[email protected]
Patch Changes
⚠️ FixreadFragment()
not inferring the types of complex fragments, i.e. fragments that derive with a union type
Submitted by @kitten (See #15)- Make
$tada.fragmentRefs
property required. Previously, this was optional (to mirror what GCG’s client-preset does). However, this can lead to invalid checks inreadFragment
, as it would be able to match types that don’t actually match the fragment refs
Submitted by @kitten (See #18)