question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Subscriptions aren't adaptable enough.

See original GitHub issue

I’m submitting a…


[ ] Regression 
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behaviour

It is not possible to use this in the subscription resolve function. This makes it incredibly hard to use services to retrieve information from given information.

https://objects.black-out.xyz/a0f6d2b https://objects.black-out.xyz/200c4ce Some screenshots of the current behaviour ^

The code I had when using type-graphql https://objects.black-out.xyz/3172643

Expected behavior

The ability to use this or services in the subscription resolve function. type-graphql didn’t force an async iterator to be returned so it was very easy to use add the equivalent of a resolve function in the actual function.

Minimal reproduction of the problem with instructions

  1. Create a resolver.
  2. Inject a service into the resolver.
  3. Create a subscription and attempt to use the service in the resolve function.

It could look something like https://objects.black-out.xyz/a4cef78

What is the motivation / use case for changing the behavior?

The current behaviour isn’t adaptable enough to build bigger graphql apps compared to things like type-graphql I did spend quite some time with a member of the discord and neither of us could think of any workarounds. There might be a nice way to do it with DI but I’m not aware.

Environment


Nest version: 6.2.4
Nest GraphQL version: 6.4.2

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
victiondevcommented, Aug 1, 2019

hey - im experiencing the same issue right now, is there any eta for when this will be fixed

0reactions
lock[bot]commented, Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Future proof: Solving the 'adaptability paradox' for the long term
Adaptability is the ability to learn flexibly and efficiently and to apply that knowledge across situations. It's not so much a skill as...
Read more >
6 Signs You're Adaptable Enough to Succeed | Inc.com
You might not yet have the ability to determine pros and cons of circumstances that haven't happened to you. 4. You argue with...
Read more >
Adaptability: The New Competitive Advantage
In a stable environment it is sufficient to improve what already exists or to examine single change proposals. The simple step of requiring...
Read more >
7 Numbers to Know About the Global Subscription Economy
Subscriptions are booming, but where are we headed? Let's look at a 7 key numbers that show the future of the rapidly growing...
Read more >
Subscriptions/real-time API support · Issue #298 · prisma ...
We are looking to figure out a flexible-enough architecture so that people could decide how they would prefer implementing the notification part ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found