Skip to content

Proxy to Graphql #376

@billmcknight1953

Description

@billmcknight1953

I am having difficulty proxying to a graphql endpoint whose endpoint is http://XXX.XXX.XXX.XXX:8080/graphql. The http-proxy-middleware code I am using in my express.js host is straightforward and simple:

app.use('/graphql', proxy({
   target: 'http://XXX.XXX.XXX.XXX:8080',
   changeOrigin: true
}));

The problem is that the response to this call is Bad Request (400) if the content type is application/json, which is the default from my Apollo grapqhl client. But curiously if I call the proxied endpoint using text/plain in POSTMAN, it works. If I call the graphql endpoint itself directly with POSTMAN, application/json it works as well. Anyone know why I am getting a Bad Request response?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions