Code Monkey home page Code Monkey logo

Comments (4)

albertshinBFG avatar albertshinBFG commented on June 15, 2024

@jaydenseric @mike-marcacci

from graphql-upload.

jaydenseric avatar jaydenseric commented on June 15, 2024

I'm not familiar with Google Cloud Run, but maybe this issue is relevant:

#129

This comment generally applies for both the Google Cloud Functions and AWS Lambda issues:

#155 (comment)

Just googling quickly, it seems Google Cloud run has a request size limit of 32 MB:

https://cloud.google.com/run/quotas

So, maybe it's cutting your requests off early if you are exceeding that?

from graphql-upload.

albertshinBFG avatar albertshinBFG commented on June 15, 2024

Hey @jaydenseric Thank you for your response!

I should clarify my problem as I'm more clear as to what may be going wrong.

I have two express servers. The first one intercepts all requests from the Frontend prior to passing the request to the backend.

Locally, this first express server isn't in use and is only in use when deployed. This is where the issue is happening and hence the difference between local and deployed.

The issue is definitely happening in this client-side express server as I have graphqlUpload implemented in my backend server and without the client-side one this whole flow works perfectly.

How do you suggest passing this multipart form from one express server to another?

I've tried to use graphqlUploadExpress middleware in my client-side express server but it still doesn't work. Do I have to use multer here?

Here's a flow chart of when it is working:

Frontend GraphQL Request -> Apollo Client (with apollo-upload-client) -> Apollo Server Express (using graphql-upload-minimal) -> Resolver (using graphql-upload-minimal scalar)

This Flow works

Here's a flow chart of when its not working
Frontend is built using express.
Frontend GraphQL Request -> Apollo Client (with apollo-upload-client) -> Express Server (sends requests to backend after Google Auth Check) -> Apollo Server Express (using graphql-upload-minimal) -> Resolver (using graphql-upload-minimal scalar)

It errors out at the Express Server. Confused as to why this extra Express layer is causing "Unexpected End of Form at Multipart._final" errors from busboy.

Any ideas would be appreciated here

from graphql-upload.

jaydenseric avatar jaydenseric commented on June 15, 2024

The problem of forwarding a GraphQL multipart request (or just part of a request) from one server to another is a well known, and in many cases a solved, problem that's particularly relevant for federated GraphQL API proxies/gateways that stitch together over HTTP multiple GraphQL APIs. This issue for example relates to that: #194 .

In your case, you might not need to do anything particularly complicated if you don't need to deconstruct the GraphQL request and only forward parts of it to other servers responsible for fulfilling those individual parts; you might be able to somehow pass through the entire multipart request stream without much effort. It's not something I've done before though, so I'm not sure exactly the best way to tackle it.

Helping out further with this is really beyond the scope of maintaining this package because it's more about setting up your particular server infrastructure. Feel free to share the final solution you come up with here, in case it helps others with a similar question.

from graphql-upload.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.