graphql-extra
graphql-extra copied to clipboard
Fix TS types being broken on every TS version after 4.0
Many months ago I mentioned issue around this error suddenly popping up with TS 4.0-dev
:
Error: Expression produces a union type too complex to represent
I filed issue on TS repo, and eventually one of the devs responded with this:
https://github.com/microsoft/TypeScript/issues/38343
So on a hunch, I figured it must be the mix-classes
library producing too many possible types. I tried to swap it out with another library that does the same thing, but more refined TS typings, and it worked.
https://github.com/tannerntannern/ts-mixer
This PR is just a Find & Replace All
to change the Mix
import from mix-classes
-> ts-mixer
, and then fix the constructor signature to suit new library.
Now the error doesn't occur :+1:
Although my IDE auto-formatted everything so some code might be formatted slightly differently