question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot separate route configs for POST and GET requests

See original GitHub issue

https://github.com/apollographql/apollo-server/blob/98268d1c6ddab874d6ad93c39d7d63bf5c568eac/packages/apollo-server-hapi/src/hapiApollo.ts#L38

This git issue was closed (incorrectly?). The reason it’s an issue is because of the referenced. https://github.com/apollographql/apollo-server/issues/3354

This came up for us when trying to change the max payload size:

  await apolloServer.applyMiddleware({
    app: hapiServer,
    path: pathname,
    route: {
      cors: true,
      payload: { maxBytes: MAX_BYTES },
    },
  });

You cannot set payload on route because the config is used for both the GET and POST requests. GET requests cannot have payload config. The plugin should allow specifying different route config for the GET and POST requests.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
arimuscommented, Nov 5, 2022

For anyone stumbling onto this issue, the integration can now be found here: https://github.com/apollo-server-integrations/apollo-server-integration-hapi/

It’s still a work in progress. Tests are passing, but there is some needed configuration support necessary.

0reactions
trevor-scheercommented, Oct 20, 2022

Looks like the person who took interest in resolving this issue (@arimus) is also the person who’s currently working on the AS 4 Hapi integration. I recommend keeping an eye out or collaborating with them on the v4 integration.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handle both GET and POST request with same route in .net ...
Have you tried to create two separate functions. One for GET and the other for POST? You can still set the Route attribute...
Read more >
Working with routes for HTTP APIs - Amazon API Gateway
Routes direct incoming API requests to backend resources. Routes consist of two parts: an HTTP method and a resource path—for example, GET /pets...
Read more >
Routing and Action Selection in ASP.NET Web API
NET Web API routes an HTTP request to a particular action on a controller. Note. For a high-level overview of routing, see Routing...
Read more >
Handle GET and POST Request in Express - CodeForGeek
Hi Brian, Its seems to be a routing issue. Please verify the route you provided for the post method is correct.
Read more >
How to Perform HTTP Requests with Axios – A Complete Guide
Sending asynchronous HTTP queries to REST endpoints and performing CRUD operations is simple using Axios POST request and GET request.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found