Skip to content
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

***Help | V2 is breaking for Apollo Server V4 #69

Open
smo043 opened this issue May 30, 2024 · 3 comments
Open

***Help | V2 is breaking for Apollo Server V4 #69

smo043 opened this issue May 30, 2024 · 3 comments

Comments

@smo043
Copy link

smo043 commented May 30, 2024

Hello,

We are using Apollo Server v4, and we have copied custom logic from PR #66 to support our new changes. Today, we see support from this package; however, after updating it, all APIs fail due to content-type. Is it possible to set a content type header for all POST requests?

Example

server.startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests();
return async (req: HttpRequest, context: InvocationContext) => {
if(req.method === 'POST') {
req.headers.set('content-type', 'application/json')
}

@barddoo
Copy link

barddoo commented Jun 12, 2024

why is it failing? not sure I understand

@barddoo
Copy link

barddoo commented Jun 12, 2024

The client has to send content-type as application/json according to graphql specification

@smo043
Copy link
Author

smo043 commented Jun 12, 2024

@barddoo - Yes, but because we have a large number of clients who use our APIs, it is difficult to contact everyone and request that they add the Content Type header. Is it possible to set the default contentType in the library if the request does not have one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants