externalUrlBase
behaves incorrectly with proxies + subscriptions + graphiql
#1232
Closed
1 of 3 tasks
Labels
I'm submitting a ...
PostGraphile version: 4.4.4 (but applicable to all versions since #1070)
Steps to reproduce:
graphiql
enabled (eg: http://localhost:3000/graphql)externalUrlBase
to/api
or undefinedCurrent behavior:
If
externalUrlBase = /api
graphiql will render, and be able to executemutation + queries
. Though any subscriptions requests will fail to complete the upgrade handshake due to the path not matching at https://github.com/DvdGiessen/postgraphile/blob/44c44e2196883b7d659ff796e1eac8c4557e0884/src/postgraphile/http/subscriptions.ts#L157If
externalUrlBase = ''
graphiql will render but will be unable to retrieve the schema or execute any requests. Subscriptions will connect correctly as expected via external clients.https://github.com/graphile/postgraphile/blob/master/src/postgraphile/http/createPostGraphileHttpRequestHandler.ts#L401
Expected behavior:
That it works in both cases, this will most likely mean that there will have to be 2 config options as opposed to just
externalUrlBase
. One option to support the mounting of postgraphile at an express route (ie the reasoning behind the change that was made in #1070 ) and the other which is purely for graphiql configThe text was updated successfully, but these errors were encountered: