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

Upgrade codebase to GraphQL v16 #1331

Merged
merged 11 commits into from
Feb 8, 2023
Merged

Upgrade codebase to GraphQL v16 #1331

merged 11 commits into from
Feb 8, 2023

Conversation

MichalLytek
Copy link
Owner

WIP

@MichalLytek MichalLytek added Enhancement 🆕 New feature or request Dependencies 📦 Pull requests that update a dependency file Bugfix 🐛 🔨 PR that fixes a known bug labels Aug 16, 2022
@MichalLytek MichalLytek self-assigned this Aug 16, 2022
@carlocorradini
Copy link
Contributor

It's happening 😍🥳

@alvis
Copy link

alvis commented Aug 17, 2022

It's coming!!! ❤️❤️❤️

@orefalo
Copy link

orefalo commented Aug 17, 2022

nice!

For anyone reading this - plz dont' forget to contribute $$$.
Maintaining an opensource project takes time and skills - nothing comes for free.

@EstebanBorai
Copy link

Thanks so much for the hard work @MichalLytek!

@angelo-moreira
Copy link

this is great, thank you, I have asked the company that I work for to contribute to this project.
❤️❤️❤️❤️❤️

@noxend
Copy link

noxend commented Aug 19, 2022

@MichalLytek thank you! 🙌❤️

@hkd987
Copy link

hkd987 commented Sep 1, 2022

I thought @MichalLytek had died or moved out to the woods leaving all traces of nodejs behind, but he has risen with an amazing Draft PR for us to all admire. May the gods of nodejs bless this draft PR with speed, no bugs, and a quick merge.

All kidding aside I really thought this project had died, and was just starting to plan our exit from type-graphql, but this PR gives me a warm fuzzy that we are headed in the right direction.

@jessekrubin
Copy link

I thought @MichalLytek had died or moved out to the woods leaving all traces of nodejs behind, but he has risen with an amazing Draft PR for us to all admire. May the gods of nodejs bless this draft PR with speed, no bugs, and a quick merge.

@hkd987 Much like Keith Richards (of the rolling stones), @MichalLytek cannot be killed by conventional weapons. He is nearly indestructible.

@bnussman
Copy link

bnussman commented Sep 5, 2022

This is exciting 🚀

@productdevbook
Copy link

reflect-metadata Can it use something else instead because it doesn't support esm. It's old.

@kt390256
Copy link

Hi Michal, this is amazing work and thank you for this! I was doing some researches and I found that the current version of tGQL only works with graphql 15.3.0, just want to know if v2.0 will be compatible with any other 15.x version(ideally 15.5) or 16.x version? Thanks in advance!

@vuki656
Copy link

vuki656 commented Sep 11, 2022

Hi Michal, this is amazing work and thank you for this! I was doing some researches and I found that the current version of tGQL only works with graphql 15.3.0, just want to know if v2.0 will be compatible with any other 15.x version(ideally 15.5) or 16.x version? Thanks in advance!

Yes it will, 16.6. check the diff.

@MichalLytek
Copy link
Owner Author

reflect-metadata Can it use something else instead because it doesn't support esm. It's old.

@productdevbook Please list something else we can use for shimming reflect metadata api

@productdevbook
Copy link

reflect-metadata Can it use something else instead because it doesn't support esm. It's old.

@productdevbook Please list something else we can use for shimming reflect metadata api

https://github.com/abraham/reflection

@MichalLytek
Copy link
Owner Author

MichalLytek commented Sep 11, 2022

@productdevbook Have you tried using that? TypeGraphQL doesn't force to use reflect-metadata:

export function ensureReflectMetadataExists() {
if (
typeof Reflect !== "object" ||
typeof Reflect.decorate !== "function" ||
typeof Reflect.metadata !== "function"
) {
throw new ReflectMetadataMissingError();
}
}

export class ReflectMetadataMissingError extends Error {
constructor() {
super(
"Looks like you've forgot to provide experimental metadata API polyfill. " +
"Please read the installation instruction for more details.",
);
Object.setPrototypeOf(this, new.target.prototype);
}
}

Maybe we can just list abraham/reflection and core-js/es7/reflect in docs as the alternatives?

@kt390256
Copy link

kt390256 commented Sep 11, 2022

@vuki656 thanks much! sorry just one more question, do you know when will this be released? very excited about this

@vuki656
Copy link

vuki656 commented Sep 12, 2022

@vuki656 thanks much! sorry just one more question, do you know when will this be released? very excited about this

I don't think there is a date.

@beeequeue
Copy link

Maybe we can just list abraham/reflection and core-js/es7/reflect in docs as the alternatives?

@abraham/reflection seems to work in my project 👍

@MaxAst
Copy link

MaxAst commented Oct 1, 2022

Hey @MichalLytek, I'm happy to contribute to this PR in case you need support! Would just need some guidance w.r.t what's still left to do

@itpropro
Copy link

itpropro commented Oct 2, 2022

Hey @MichalLytek, I'm happy to contribute to this PR in case you need support! Would just need some guidance w.r.t what's still left to do

If we work on #1356, @MaxAst can also get a contribution towards his hacktoberfest stats 💪

@arimus
Copy link

arimus commented Oct 7, 2022

Any word @MichalLytek at what is left and how we might be able to help?

I'm currently trying to create an Apollo server v4 Hapijs adapter, but looks like upgrading Apollo server pushes graphql to v16 and thus triggers this issue in the project I'm using to do the dev.

@MichalLytek
Copy link
Owner Author

If someone wants to help, please checkout the branch and run every example to see if all the presented features works ok. The one I've updated the codebase (like apollo federation or mikro-orm) should be checked but e.g. subscriptions might not work.

@MichalLytek
Copy link
Owner Author

MichalLytek commented Jan 20, 2023

It would not contain any change. The branch is just rebased from time to time:
image

@bombillazo
Copy link

Also, any documented changes to have an idea about the breaking changes?

@MichalLytek
Copy link
Owner Author

@bombillazo https://github.com/MichalLytek/type-graphql/blob/new-major-release/CHANGELOG.md#unreleased

@abjrcode
Copy link

I have tried to upgrade my project which uses this library extensively to use (2.0-beta) and I think I found a small bug in auth-middleware.ts.

It tries to check the prototype of authChecker to decide if it is a function or a class but functions which aren't arrow functions do have a prototype so it mistakenly thinks it needs to insatiate a class from the container

@MichalLytek
Copy link
Owner Author

@abjrcode Unfortunately, it's the only legit way to detect whether it's an arrow function or ES6 class. This check works for all other kind of checks, with middlewares too.
Happy to see a proposal of better mechanism, maybe new ES have something more sophisticated than printing the source code and regexing for class/function keyword.

@cjnoname
Copy link

Hi @MichalLytek ,

We have successfully upgraded to v2 beta and it works perfectly. Looking forward for the formal release.

Thanks

@bombillazo
Copy link

Been testing for a few days, no issues so far and we were able to migrate to Apollo 4 thanks to this!

@loan-laux
Copy link

Same here.

@fknop
Copy link

fknop commented Feb 4, 2023

Can the beta version be considered stable? As in API changes?
Any ETA on the final release? :)

@MichalLytek MichalLytek changed the title TypeGraphQL v2.0 Upgrade codebase to GraphQL v16 Feb 8, 2023
@MichalLytek MichalLytek marked this pull request as ready for review February 8, 2023 14:30
@MichalLytek MichalLytek merged commit d3ecacd into master Feb 8, 2023
@MichalLytek MichalLytek deleted the new-major-release branch February 8, 2023 14:31
@carlocorradini
Copy link
Contributor

Awesome! 😎🥳

@MichalLytek
Copy link
Owner Author

The PR has been renamed to GraphQL v16 support as that was the main scope of the changes.

The work on the v2.0 release will be done step-by-step on the master branch.
More info here: #1418

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix 🐛 🔨 PR that fixes a known bug Dependencies 📦 Pull requests that update a dependency file Enhancement 🆕 New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.