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.

Dependency exception when not using Subscriptions

See original GitHub issue

With version 9.1.0-preview.35 the application that is not using subscriptions will see a dependency exception that reads like the following

Unable to resolve service for type ‘HotChocolate.AspNetCore.Subscriptions.IMessagePipeline’ while attempting to activate ‘HotChocolate.AspNetCore.Subscriptions.SubscriptionMiddleware’.

This is because ApplicationBuilderExtensions.UseGraphQL always registers SubscriptionMiddleware but it’s dependencies aren’t registered unless SubscriptionServiceCollectionExtensions.AddGraphQLSubscriptions is also called.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
michaelstaibcommented, Dec 4, 2019

It is quite easy to do that … I can borrow you some code for that. We will I think have this feature also in with V12. But I can give you some snippets for a basic rest middleware and the it is very easy to stitch rest in or OData. Can you join our slack channel? The invitation link is on our readme… the we can discuss things further.

1reaction
michaelstaibcommented, Dec 2, 2019

hi @okosodovictor,

this is a bug that we introduced in version 10. The stitching layer is basically missing the message pipeline. You can either add it.

services.AddGraphQLSubscriptions();

or you choose to remove the subscription middleware by specifying which transport middleware you want to use:

app
    .UseGraphQLHttpPost()
    .UseGraphQLHttpGet()
    .UseGraphQLHttpGetSchema();

regarding the UseGraphQLHttpGetSchema() middleware. This is kind of optional and also this particular middleware has an issue with .NET Core 3. We are currently working on a fix for 10.3.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dependency exception when not using Subscriptions #935
this is a bug that we introduced in version 10. The stitching layer is basically missing the message pipeline. You can either add...
Read more >
How to deal with errors and exceptions during dependency ...
I've had discussion about this in the contect of Java EE, EJB 3 and resources. My understanding is that we need to distinguish...
Read more >
Dependency Exception - Umbraco Cloud
The error indicates that on the Home page , a picker, for example, refers to another content item. This other content item has...
Read more >
Circular Dependencies in Spring
A quick writeup on dealing with circular dependencies in Spring: how they occur and several ways to work around them.
Read more >
Exception Handling in Spring MVC
Our goal is to not handle exceptions explicitly in Controller methods where ... Spring Boot allows a Spring project to be setup with...
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