Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to add HTTP headers on top of ApolloClient ones #4754

Merged
merged 5 commits into from
Mar 15, 2023
Merged

Conversation

martinbonnin
Copy link
Contributor

See #4753

@martinbonnin martinbonnin requested a review from BoD as a code owner March 14, 2023 15:10
@netlify
Copy link

netlify bot commented Mar 14, 2023

Deploy Preview for apollo-android-docs canceled.

Name Link
🔨 Latest commit 89e9d69
🔍 Latest deploy log https://app.netlify.com/sites/apollo-android-docs/deploys/64119bd09d432000085c7d04

Copy link
Contributor

@BoD BoD left a comment

Choose a reason for hiding this comment

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

👍

@martinbonnin
Copy link
Contributor Author

Bad news everyone, this broke this test because interceptors work with ApolloRequest and they don't know about headers vs additionalHeaders (which makes sense). I'll revisit.

@martinbonnin
Copy link
Contributor Author

These tests failing lead me to a somewhat better solution leaving the public API untouched 👌 . ApolloRequest is the same, it all happens in ApolloCall now. Let me know what you think

@@ -185,8 +182,23 @@ object SchemaDownloader {

inline fun <reified T> Any?.cast() = this as? T

private fun getIntrospectionQuery(includeDeprecatedInputFieldsAndArguments: Boolean): String {
val includeDeprecated = if (includeDeprecatedInputFieldsAndArguments) "(includeDeprecated: true)" else ""
fun getIntrospectionQuery(specVersion: SpecVersion): String {
Copy link
Contributor

Choose a reason for hiding this comment

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

Some unrelated commit got in the way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. I just rebased again. Should be good this time.

Copy link
Contributor

@BoD BoD left a comment

Choose a reason for hiding this comment

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

Even better 👍

@martinbonnin martinbonnin merged commit 9e5db11 into main Mar 15, 2023
@martinbonnin martinbonnin deleted the add-headers branch March 15, 2023 15:44
martinbonnin added a commit that referenced this pull request Mar 28, 2023
* allow to add HTTP headers on top of ApolloClient ones

* keep binary compatibility

* update apiDump

* fix adding several headers

* udate apiDump
@martinbonnin martinbonnin mentioned this pull request Apr 3, 2023
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.

None yet

2 participants