Closed ssukienn closed 2 years ago
I think for subscriptions it is a bit different since the protocol can also be different. i.e. it could be https://app.graphy.top:3000/subscriptions
or wss://app.graphy.top:3000/subscriptions
but there is no way to tell which if we only accept the path
and not the full URL
Hmm that's true, what about if the domain still match and protocol could be choosen? Either http(s)/ws(s) etc.
So we would have an extra option for subscriptionProtocol
?
Yes, like this or generally something shaped more into connection url object like configuration?
Btw, I made mistake in issue description. From the beginning I had in mind switching protocol for subscriptions but it is true that it does 't have to be wss always
Is your feature request related to a problem? Please describe. I would like to only setup the
subscriptionsEndpoint
path in the express middleware config, not the full URL. Similarly toendpointURL
where I can do it.Describe the solution you'd like Maybe next option that would expect only the path i.e
/subscriptions
? I thinkthe usageEndpoint/URL
in this case might be confusing. What I would expect is with that option the URL is taken from normal request URL and subscriptions path would be glued to it so with regular endpoint like:https://app.service.top:3000/graphql
subscriptions would becomehttps://app.graphy.top:3000/subscriptions
and would be preset in the Subscriptions URL config.Describe alternatives you've considered Staying with the single config option but in case of the parameter passed being only path (like
/subscriptions
) not full fledged URL spec compliant it would automatically assume to use regular request URL (minus/graphl
ofc).Additional context It is possible that maybe I miss something here.