Closed kitten closed 7 months ago
Latest commit: e0e4f7a179774536f1ea249201e64290cb67d499
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
[Click here if you're a maintainer who wants to add another changeset to this PR](https://github.com/0no-co/gql.tada/new/feat/allow-generic-fragments?filename=.changeset/fluffy-zebras-wave.md&value=---%0A%22%40fake-scope%2Ffake-pkg%22%3A%20patch%0A---%0A%0Afix%3A%20Allow%20%60readFragment()%60%20to%20accept%20fragment%20document%20as%20a%20generic%0A)
Summary
This allows the document in
readFragment
to be passed as a generic, removing the need to keep fragments around as a runtime value.Replacing
readFragment
's complex type argument and data generic with an overload is long and wordy, but potentially makes it simpler for TypeScript to evaluate and prevents us having to maintainmirrorTypeRec
.In case this is needed, we can add its definition back to the overload, but this wouldn't be compatible with being able to pass just one generic for the document.
Set of changes
maskFragments
andreadFragment
definitions with overloadsreadFragment
to only accept one argument