Enable crunching with X-Crunch header and crunch entire response#1061
Merged
alloy merged 5 commits intoartsy:masterfrom May 30, 2018
Merged
Enable crunching with X-Crunch header and crunch entire response#1061alloy merged 5 commits intoartsy:masterfrom
alloy merged 5 commits intoartsy:masterfrom
Conversation
Contributor
Author
|
See artsy/emission#1068 for emission implementation. |
Contributor
Author
|
When responses are crunched the response now has an |
Contributor
|
Yup, this a good idea 👍 As an aside (no blocker), do we even really need the query parameter? |
Contributor
Author
|
It's not strictly necessary, but it also doesn't really hurt. It's probably easier to use graphiql with the query param. It's just another options for any clients that are connecting. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows enabling the crunching of a response (#1042) via an
X-Crunchheader. It'll just be a little bit easier to integrate into some of the projects this way.In emission, the current approach would require us to process the URL to safely add the query parameter. Enabling it via a header would just be a bit cleaner.
This also updates how crunching works. It crunches the entire response instead of just the data portion. Being as crunching is a lossless process there's no harm in doing so. Also it reduces the overall logic that we have to share across projects.