graphql-client icon indicating copy to clipboard operation
graphql-client copied to clipboard

Subscription Fails silently when using InitPayload

Open maaft opened this issue 4 years ago • 2 comments
trafficstars

When using these websocket options, subscriptions fail silently without any error. Is this the correct usage?

client.Options.ConfigureWebSocketConnectionInitPayload = o =>
        new Dictionary<string, string>
        {
          {"X-DUG-Auth", "XXXXXXXXXXXXXX"}
        };

maaft avatar Dec 14 '20 13:12 maaft

@maaft you can see this closed issue (https://github.com/graphql-dotnet/graphql-client/issues/304) where I asked the same. There you have an example.

You have to set a Func(GraphQLHttpClientOptions options) not a Dictionary<string, string>

ClarenceMG avatar Dec 17 '20 16:12 ClarenceMG

@maaft you can see this closed issue (#304) where I asked the same. There you have an example.

You have to set a Func(GraphQLHttpClientOptions options) not a Dictionary<string, string>

@ClarenceMG , I tried the same way you have mentioned in your issue . Though I was able to validate the header through payload, i found that the call dint go to Subscription's resolver in my server. Note: I used DefaultSocketSessionIntercpetor class to validate token.

Archuna avatar Apr 08 '21 11:04 Archuna