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.

File uploads in apollo-server-hapi appear broken

See original GitHub issue

Package name

Here are the relevant package versions:

  • apollo-server-hapi@2.9.3
  • apollo-server-core@2.9.3
  • @hapi/hapi@18.3.2

I’ve tested this on Node.js 10.16.3 and npm@6.9.0.

Expected behavior

I expect file uploads as described in the “File uploads” documentation to work with apollo-server-hapi.

Actual behavior

The server always sends 400 errors with a message of “GET query missing.”

Reproducible

I made https://github.com/swashcap/apollo-hapi-upload to show the problem. That project’s test is essentially copied from here: https://github.com/apollographql/apollo-server/blob/10402c46013920b5c9cd64d5ae1cc41f5fe5ceb5/packages/apollo-server-hapi/src/__tests__/ApolloServer.test.ts#L411-L496

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
mkgocommented, Nov 20, 2019

Any updates to this issue? I am hitting the same problem with our Hapi/Graph platform.

Also, the fact that none of the values are coming back ie: filename, encoding etc…

Has anyone found a workaround if this has not been fixed?

0reactions
glassercommented, Oct 18, 2022

Integration with a fork of an old version of graphql-upload was removed from Apollo Server last year in AS3.

Additionally, Apollo Server 4 replaces a hard-coded set of web framework integrations with a simple stable API for building integrations. As part of this, the core project no longer directly supports a Hapi integration. It should not be that hard for excited Hapi users to build and maintain a Hapi integration, and our guess is they will do a better job of it than the Apollo Server core team, who did not use Hapi at all other than to maintain the integration. There is not a Hapi integration at this time, but some interest has been expressed over at https://github.com/apollographql/apollo-server/issues/6028. Sorry for the delay!

Read more comments on GitHub >

github_iconTop Results From Across the Web

File uploads - Apollo GraphQL Docs
Enabling file uploads in Apollo Server. ... For server integrations that support file uploads (e.g. Express, hapi, Koa), Apollo Server enables file uploads...
Read more >
Apollo Server File Upload Best Practices - Apollo GraphQL Blog
One approach is to ensure that the GraphQL server itself can directly accept uploads, by adding a parser for multipart requests that contain ......
Read more >
Migrating to Apollo Server 4 - Apollo GraphQL Docs
For a list of all breaking changes, see the changelog. This guide helps you migrate from Apollo Server 3 to Apollo Server 4....
Read more >
Migrating to Apollo Server 3 - Apollo GraphQL Docs
File uploads. Apollo Server 2 provides built-in support for file uploads via an outdated version of the graphql-upload library. Using an updated version ......
Read more >
File Uploads with Apollo Server 2.0 - Apollo GraphQL Blog
Update: May 2022For our recommendation on how to handle file uploads, read Apollo Server File Uploads Best Practices.
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