Skip to content

Conversation

maraisr
Copy link
Member

@maraisr maraisr commented Nov 25, 2020

From the graphql/graphql-over-http#152 we no longer need content-length things. This PR aims to parse till a boundary, and yield then.

cc @robrichard

acao pushed a commit to graphql/express-graphql that referenced this pull request Dec 2, 2020
This removes the need for `Content-Length`, and handles the boundaries such that the next boundary is flushed as soon as possible.

References:
- graphql/graphql-over-http#152
- fmg relay-tools/fetch-multipart-graphql#22
- [meros](https://github.com/maraisr/meros)
this.onResponse = onResponse;
this.processedChunks = 0;
this.chunkBuffer = '';
this.isPreamble = true;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you explain what is and the importance of the isPreamble?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything before the first boundary should be ignored. So this just tracks that we've passed the first boundary. Another way could have been to increment a number, and simply not yield if less than 1.

robrichard pushed a commit to graphql/express-graphql that referenced this pull request Dec 3, 2020
This removes the need for `Content-Length`, and handles the boundaries such that the next boundary is flushed as soon as possible.

References:
- graphql/graphql-over-http#152
- fmg relay-tools/fetch-multipart-graphql#22
- [meros](https://github.com/maraisr/meros)
@robrichard robrichard merged commit 6de3715 into relay-tools:master Dec 10, 2020
@maraisr maraisr deleted the clength-edits branch December 10, 2020 04:22
robrichard pushed a commit to graphql/express-graphql that referenced this pull request Feb 9, 2021
This removes the need for `Content-Length`, and handles the boundaries such that the next boundary is flushed as soon as possible.

References:
- graphql/graphql-over-http#152
- fmg relay-tools/fetch-multipart-graphql#22
- [meros](https://github.com/maraisr/meros)
DragonWarrior812 added a commit to DragonWarrior812/GraphQL-Express that referenced this pull request Sep 16, 2025
This removes the need for `Content-Length`, and handles the boundaries such that the next boundary is flushed as soon as possible.

References:
- graphql/graphql-over-http#152
- fmg relay-tools/fetch-multipart-graphql#22
- [meros](https://github.com/maraisr/meros)
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

Successfully merging this pull request may close these issues.

3 participants