Closed robinelvin closed 2 months ago
Please do not use "type-graphql": "next"
but point to selected beta version in the package.json.
Then when new beta is published, please read the release notes and update the package version.
someIterator
Please create a minimal, reproducible code example.
Be aware that the typings have been fixed and graphql-subscription
pub sub iterator has wrong typing.
I've tried the beta versions one by one and the latest working version for me is 2.0.0-beta.2
Sorry if I'm misunderstanding but I don't know why I am unable to use this subscribe
method signature now if I am following the example from https://typegraphql.com/docs/subscriptions.html#creating-subscriptions which clearly shows it.
For clarification I am talking about the method parameters not the return type.
Please create a minimal reproducible code example repository. I can't debug from your super small snippets.
I have found what's wrong in your example. The docs were wrong or outdated. The proper signature of this function is subscribe: ({ root, args, context, info }) => { ... }
.
I've updated the docs in 20271ba, so closing this issue🔒
Describe the Bug Types from 2.0.0-beta.6 have broken the alternative
subscribe
method signature.To Reproduce
Use this method signature:
Typescript reports:
Expected Behavior The type check should pass.
Logs If applicable, add some console logs to help explain your problem. You can paste the errors with stack trace that were printed when the error occurred.
Environment (please complete the following information):
Additional Context This was previously working with the package declaration of
"type-graphql": "next",
To fix another unrelated problem I had to remove myyarn.lock
file and re-create which I think must have upgradedtype-graphql
from whichever version I had previously.