-
-
Notifications
You must be signed in to change notification settings - Fork 570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
externalUrlBase
behaves incorrectly with proxies + subscriptions + graphiql
#1232
Comments
Yes, you're right - we need two settings here. If we take a slightly more complex example: https://example.com/api/graphql -> http://localhost:3000/route/graphql assuming you have something like To PostGraphile within Express over HTTP we have To PostGraphile websockets we need to match incoming Often I'd love a PR for this 👍 |
Alright, I'll bite. Just hit this, and seems like a reasonably straight forward place to jump in as 1st time contributor? |
I think so! 🙌 Any questions; @ me on #dev-postgraphile in Discord: https://discord.gg/graphile |
Hey @danbiagini did you get a chance to look at this? |
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: