graphql-extra icon indicating copy to clipboard operation
graphql-extra copied to clipboard

Fix TS types being broken on every TS version after 4.0

Open GavinRay97 opened this issue 4 years ago • 0 comments

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: image

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

GavinRay97 avatar Sep 01 '20 16:09 GavinRay97