-
Notifications
You must be signed in to change notification settings - Fork 6
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
type-graphql 0.18 #16
Comments
It shouldn't have any effect, but i'll check tomorrow, thanks for the issue ! :) |
Okay there's definitely a problem with 0.18.0 and the way we wait for types to become available before registering them in type-graphql's metadata. @birkir for now a quick and dirty workaround that should work is to await one tick before building the schema. // Just give auto-relay time to catch up
await Promise.resolve()
// And build the schema
const schema = await buildSchema({
resolvers: [TestResolver],
}); I'll have to rewrite part of the lib to avoid that behavior, but in the meantime this should work. Lemme know |
Sounds good! Thanks for looking into this |
Hi @Superd22, I'm currently using type-graphql 0.17.6 and having the same issue as described above.
package.json
|
@Superd22 thanks for the hard work, I'm looking for a solution for 0.17.6 as well. |
Hey guys. @idoshamun are you by any chance using a glob import aswell rather than direct imports ? I have a suspicion that those are the culprit. There's definitively something iffy about the way AutoRelay hooks into TypeGraphql's lifecycle (hence the "wait one tick" workaround) and we'll have to rework that sooner rather than later anyway. |
@Superd22 thanks for the quick response, this is exactly what I'm doing |
Following your advice, it is now working! 🎉
|
Hey, i've just pushed 0.12.6, this should fix that :) |
You're the best! Checking now |
Works perfectly |
@Superd22 I'm looking forward seeing this fixed soon! Maybe you could give any pointers to help fixing this problem? Thanks for auto-relay! |
This also caused an issue for me. Commenting with my setup if it helps debug the issue, and can check any fixes. Dependencies "dependencies": {
"@auto-relay/typeorm": "^0.13.1",
"@middy/core": "2.5.3",
"apollo-server-env": "^4.2.0",
"apollo-server-errors": "^3.3.0",
"apollo-server-lambda": "^3.5.0",
"auto-relay": "^0.13.1",
"axios": "^0.24.0",
"class-validator": "^0.13.2",
"faker": "^5.5.3",
"graphql": "^15.7.2",
"graphql-relay": "^0.9.0",
"pg": "^8.7.1",
"reflect-metadata": "^0.1.13",
"source-map-support": "^0.5.21",
"type-graphql": "^1.1.1",
"type-graphql-dataloader": "^0.5.0",
"typeorm": "^0.2.41",
"typeorm-seeding": "^1.6.1"
}, I'm importing resolvers via class rather than glob as needed for Typescript compilation / packaging const schema = await buildSchema({
resolvers: [AccountResolver, etc],
}); And adding await Promise.resolve(); just before buildSchema did help for now. Thank you for you brilliant work, much nicer than manually writing all the connection classes manually. |
Hey, great work!!
I am trying to use it with a project where I need to use type-graphql 0.18.0-beta because of a bug in previous versions not allowing multiple
buildSchema
to work in a single nodejs instance.However it may seem like that update broke this library, I don't get any errors or anything, but my
@RelayedQuery
decorated function don't show up.MichalLytek/type-graphql#415
The text was updated successfully, but these errors were encountered: