Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Class constructor GraphQLList cannot be invoked without 'new' #258

Closed
justinwilaby opened this issue Jan 18, 2023 · 3 comments · Fixed by #259
Closed

TypeError: Class constructor GraphQLList cannot be invoked without 'new' #258

justinwilaby opened this issue Jan 18, 2023 · 3 comments · Fixed by #259

Comments

@justinwilaby
Copy link

When targeting ES6, the following error is output to the console:

TypeError: Class constructor GraphQLList cannot be invoked without 'new'
    at generateGraphQLHandlers.js:100:1
    at Array.reduce (<anonymous>)
    at createComparatorGraphQLInputType (generateGraphQLHandlers.js:99:1)
    at ./node_modules/@mswjs/data/lib/model/generateGraphQLHandlers.js (generateGraphQLHandlers.js:107:1)
    at __webpack_require__ (bootstrap:19:1)
    at ./node_modules/@mswjs/data/lib/factory.js (factory.js:41:33)
    at __webpack_require__ (bootstrap:19:1)
    at ./node_modules/@mswjs/data/lib/index.js (index.js:11:17)
    at __webpack_require__ (bootstrap:19:1)
    at ./src/mocks/handlers/sxxxxr.db.ts (xxxxxxx.ts:122:3)

Adding new at the line specified fixes the issue.

@justinwilaby justinwilaby changed the title ypeError: Class constructor GraphQLList cannot be invoked without 'new' TypeError: Class constructor GraphQLList cannot be invoked without 'new' Jan 18, 2023
@kettanaito
Copy link
Member

Hey, @justinwilaby. Thanks for reporting this.

I confirm this is a bug on this line:

const fieldType = ['between', 'notBetween', 'in', 'notIn'].includes(comparatorFn) ? GraphQLList(type) : type

Will release the fix later this week.

@kettanaito
Copy link
Member

Released: v0.11.1 🎉

This has been released in v0.11.1!

Make sure to always update to the latest version (npm i @mswjs/data@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

@justinwilaby
Copy link
Author

justinwilaby commented Jan 20, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants