mercurius icon indicating copy to clipboard operation
mercurius copied to clipboard

Playground endpoint is not dynamic

Open astghikxachatryan opened this issue 1 year ago • 2 comments

const url = ${window.location.protocol}//${host}${window.GRAPHQL_ENDPOINT}``

Playground doesn't work on URLs like this https://foo.com/comments/graphiql. https://foo.com/comments/ is the API getaway URL that routes to our comments service and comments service is based on Mercurius. In this case code just ignores the part after host(in my case comments)

And playground calls to wrong qraphql url. It calls https://foo.com/graphql instead of https://foo.com/comments/graphql

astghikxachatryan avatar Jun 26 '23 20:06 astghikxachatryan

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

mcollina avatar Jun 27 '23 08:06 mcollina

@mcollina we are deploying graphql api and using this package and we are also facing the same issue. I have created the fix . Please review and approve it.

glg-satish-tripathi avatar Oct 20 '23 03:10 glg-satish-tripathi