Skip to content

Latest commit

 

History

History
499 lines (334 loc) · 24.7 KB

CHANGELOG.md

File metadata and controls

499 lines (334 loc) · 24.7 KB

gql.tada

1.8.10

Patch Changes

  • Updated dependencies (See #409 and #401)
    • @gql.tada/cli-utils@1.6.3

1.8.9

Patch Changes

  • Add missing setter to loc property Submitted by @kitten (See #400)

1.8.8

Patch Changes

  • Add loc getter to parsed DocumentNode fragment outputs to ensure that using fragments created by gql.tada's graphql() function with graphql-tag doesn't crash. graphql-tag does not treat the DocumentNode.loc property as optional on interpolations, which leads to intercompatibility issues Submitted by @kitten (See #396)

1.8.7

Patch Changes

  • Update internal type signature of initGraphQLTada<>() function and include initGraphQLTada<Setup> alias type. This alias type makes it more intuitive to declare types the return type of initGraphQLTada(), since it mirrors the same name Submitted by @kitten (See #377)
  • Updated dependencies (See #386 and #388)
    • @gql.tada/internal@1.0.8
    • @gql.tada/cli-utils@1.6.2

1.8.6

Patch Changes

  • Remove redundant never default on readFragment<Document>() signature (explicit generic passed) Submitted by @kitten (See #371)
  • Upgrade dependencies Submitted by @kitten (See #373)
  • Allow readFragment(doc, data) to narrow output's __typenames by the input type Submitted by @kitten (See #372)
  • Add __typename narrowing of unmasked interface fragment spreads, which could otherwise lead to confusion. This usually is relevant when the parent selection set forgets to include a __typename selection Submitted by @kitten (See #368)
  • Improve type output readability for interfaces with narrowed types Submitted by @kitten (See #370)
  • Updated dependencies (See #373)
    • @gql.tada/cli-utils@1.6.1
    • @gql.tada/internal@1.0.7

1.8.5

Patch Changes

  • Updated dependencies (See #361, #358, #359, and #363)
    • @gql.tada/cli-utils@1.6.0
    • @gql.tada/internal@1.0.6

1.8.4

Patch Changes

  • Updated dependencies (See #356, #353, and #355)
    • @gql.tada/cli-utils@1.5.3

1.8.3

Patch Changes

  • Extend readFragment types to allow | {} optional fragments to be matched. When a fragment is annotated with a directive making it optional (such as @include, @skip, or @defer) then its typed as optional. readFragment previously didn't know how to match these types, but it will now match T | {} and infer the type as such Submitted by @kitten (See #349)
  • Updated dependencies (See #350)
    • @gql.tada/internal@1.0.5
    • @gql.tada/cli-utils@1.5.2

1.8.2

Patch Changes

  • Updated dependencies (See #340)
    • @gql.tada/internal@1.0.4
    • @gql.tada/cli-utils@1.5.1

1.8.1

Patch Changes

  • Updated dependencies (See #334 and #334)
    • @gql.tada/internal@1.0.3
    • @gql.tada/cli-utils@1.5.0

1.8.0

Minor Changes

  • Add gql.tada/ts-plugin alias for @0no-co/graphqlsp Submitted by @kitten (See #62)

Patch Changes

  • ⚠️ Fix @defer, @skip, and @include optional fragments causing types to become exponentially more complex to evaluate, causing a recursive type error. Instead, merging field types and sub-selections from fragments is now separated, as needed Submitted by @kitten (See #319)
  • Updated dependencies (See #62, #329, and #62)
    • @gql.tada/cli-utils@1.4.0
    • @gql.tada/internal@1.0.2

1.7.6

Patch Changes

  • Updated dependencies (See e6f8dbc and #317)
    • @gql.tada/cli-utils@1.3.10
    • @gql.tada/internal@1.0.1

1.7.5

Patch Changes

  • ⚠️ Fix Vue not transpiling to .tsx files properly due to missing SFC plugin Submitted by @JoviDeCroock (See #305)
  • Updated dependencies (See #305)
    • @gql.tada/cli-utils@1.3.9

1.7.4

Patch Changes

  • Updated dependencies (See #303)
    • @gql.tada/cli-utils@1.3.8

1.7.3

Patch Changes

  • Updated dependencies (See #301)
    • @gql.tada/cli-utils@1.3.7

1.7.2

Patch Changes

  • Updated dependencies (See #298)
    • @gql.tada/cli-utils@1.3.6

1.7.1

Patch Changes

  • Updated dependencies (See #296 and #295)
    • @gql.tada/internal@1.0.0
    • @gql.tada/cli-utils@1.3.5

1.7.0

Minor Changes

Patch Changes

  • Updated dependencies (See #284, #282, and #286)
    • @gql.tada/internal@0.4.0
    • @gql.tada/cli-utils@1.3.4

1.6.3

Patch Changes

  • Updated dependencies (See #275)
    • @gql.tada/cli-utils@1.3.3

1.6.2

Patch Changes

  • Updated dependencies (See #270)
    • @gql.tada/internal@0.3.3
    • @gql.tada/cli-utils@1.3.2

1.6.1

Patch Changes

  • Updated dependencies (See #266 and #268)
    • @gql.tada/cli-utils@1.3.1
    • @gql.tada/internal@0.3.2

1.6.0

Minor Changes

Patch Changes

  • Updated dependencies (See #264, #261, and #261)
    • @gql.tada/cli-utils@1.3.0
    • @gql.tada/internal@0.3.1

1.5.8

Patch Changes

  • Updated dependencies (See #255, #253, and #254)
    • @gql.tada/internal@0.2.4
    • @gql.tada/cli-utils@1.2.2

1.5.7

Patch Changes

  • Switch between ESM and CJS when running CLI Submitted by @kitten (See #252)
  • Updated dependencies (See #247, #251, #247, #249, and #251)
    • @gql.tada/cli-utils@1.2.1
    • @gql.tada/internal@0.2.3

1.5.6

Patch Changes

  • Ensure that graphql.scalar() accepts value arguments as-is, so excess properties trigger an error Submitted by @kitten (See #243)
  • Updated dependencies (See #241, #239, and #239)
    • @gql.tada/cli-utils@1.2.0
    • @gql.tada/internal@0.2.2

1.5.5

Patch Changes

  • Updated dependencies (See #236)
    • @gql.tada/cli-utils@1.1.1

1.5.4

Patch Changes

  • Updated dependencies (See #232 and #230)
    • @gql.tada/cli-utils@1.1.0

1.5.3

Patch Changes

  • Updated dependencies (See #227 and #225)
    • @gql.tada/cli-utils@1.0.3

1.5.2

Patch Changes

  • ⚠️ Fix readFragment falling back to any type when called with invalid data or invalid type Submitted by @kitten (See #216)
  • Updated dependencies (See #222 and #214)
    • @gql.tada/internal@0.2.1
    • @gql.tada/cli-utils@1.0.2

1.5.1

Patch Changes

  • Updated dependencies (See #212)
    • @gql.tada/cli-utils@1.0.1

1.5.0

Read the full release announcement post at: https://gql-tada.0no.co/devlog/2024-04-15

Minor Changes

  • Allow GraphQL enum types to be remapped with the scalars configuration option Submitted by @kitten (See #184)
  • Support a second argument in graphql.persisted which accepts a TadaDocumentNode rather than passing a generic. This allows the document node to not be hidden, to still generate documentId via gql.tada without having to hide the document during runtime Submitted by @JoviDeCroock (See #188)

Patch Changes

1.4.3

Patch Changes

  • Updated dependencies (See #172)
    • @gql.tada/internal@0.1.3
    • @gql.tada/cli-utils@0.3.3

1.4.2

Patch Changes

  • Upgrade @0no-co/graphql.web to 1.0.5 Submitted by @kitten (See #168)
  • Updated dependencies (See #163, #168, #163, and #165)
    • @gql.tada/internal@0.1.2
    • @gql.tada/cli-utils@0.3.2

1.4.1

Patch Changes

  • Improve type inference performance of hot-path that computes fragment spreads. The getFragmentsOfDocuments type has been refactored and will now have a lower impact on performance Submitted by @kitten (See #159)
  • Add typescript to peerDependencies Submitted by @kitten (See #156)
  • Updated dependencies (See #156)
    • @gql.tada/cli-utils@0.3.1
    • @gql.tada/internal@0.1.1

1.4.0

Minor Changes

  • Accept a pre-processed schema when setting up gql.tada for the AbstractSetupSchema.introspection option. This allows us to map an IntrospectionQuery ahead of time Submitted by @kitten (See #147)
  • Add @gql.tada/internal package to extract common logic between the CLI and the LSP Submitted by @JoviDeCroock (See #149)
  • Change the default scalar type of ID to be string, as the GraphQL spec recommends it to serialize to a string Submitted by @JoviDeCroock (See #146)

Patch Changes

  • Remove stringLiteral generic constraint, causing errors depending on TypeScript version Submitted by @kitten (See #151)
  • Updated dependencies (See #155, #150, and #149)
    • @gql.tada/cli-utils@0.3.0
    • @gql.tada/internal@0.1.0

1.3.6

Patch Changes

  • ⚠️ Fix tokenizer not handling repeated digits for floats Submitted by @kitten (See #140)

1.3.5

Patch Changes

  • Updated dependencies (See #135)
    • @gql.tada/cli-utils@0.2.0

1.3.4

Patch Changes

  • Updated dependencies (See #131)
    • @gql.tada/cli-utils@0.1.2

1.3.3

Patch Changes

  • Replace redundant $tada.ref value on $tada.fragmentRefs definitions for masked fragments with typename string literal. The record for fragment masks is already namespaced, so there wasn't a need to use a symbol value here, and this further increases readability and usefulness Submitted by @kitten (See #126)
  • Allow readFragment() to accept the document as a generic rather than a (runtime value) argument. This replaces the complex mapping type for input arguments, and hence drops the (undocumented) support for nested arrays being passed to it Submitted by @kitten (See #128)

1.3.2

Patch Changes

  • ⚠️ Fix tokenizer hitting tail recursion limit by recursing on each ignored token Submitted by @kitten (See #125)
  • Allow readFragment to be called again on an already unmasked fragment Submitted by @kitten (See #124)
  • Re-export DocumentDecoration Submitted by @kitten (See #113)
  • Updated dependencies (See #120)
    • @gql.tada/cli-utils@0.1.1

1.3.1

Patch Changes

  • Refactor internal GraphQL document parser to use a tokenizer phase, which further utilizes TypeScript’s tail recursion optimization. This should help to further improve type inference performance Submitted by @kitten (See #111)

1.3.0

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 with isolatedModules: 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 to true on the setupSchema 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/cli-utils@0.1.0

1.2.1

Patch Changes

  • Remove type name constraint from graphql.scalar’s type name to improve type checking performance Submitted by @kitten (See #53)
  • Improve performance of several smaller types (Thank you, @deathemperor & @HaiNNT) Submitted by @kitten (See #51)

1.2.0

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

  • Tighten up type strictness to not accept operation documents where fragment documents are expected Submitted by @kitten (See #41)

1.1.0

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)

1.0.3

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 an extends, 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 in recursiveTypeRelatedTo. This work has been eliminated and should help performance Submitted by @kitten (See #26)

1.0.2

Patch Changes

  • ⚠️ Fix readFragment() 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 in readFragment, as it would be able to match types that don’t actually match the fragment refs Submitted by @kitten (See #18)

1.0.1

Patch Changes

  • ⚠️ Fix __typename literal string not being exact and instead a union of possible types, when the __typename field is put onto an abstract type’s selection set Submitted by @kitten (See #11)

1.0.0

Initial Release

gql.tada is a GraphQL document authoring library, inferring the result and variables types of GraphQL queries and fragments in the TypeScript type system. It derives the types for your GraphQL queries on the fly allowing you to write type-safe GraphQL documents quickly.

To get started, check out the documentation’s “Get Started” section.