-
Notifications
You must be signed in to change notification settings - Fork 655
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ApolloClient and ApolloRequest APIs from With-ers to Builders (#…
…3404) * Add Builders proposal to design-docs * Make Builders mutable and simplify constructor, following review. Also add precision about splitting ExecutionParameters and adding a toBuilder method. * Make ApolloClient's API Builder based instead of With-er based * Add ApolloClient.newBuilder extension * Make ApolloRequest's API Builder based instead of With-er based * Split ExecutionParameters in 2 interfaces: read-only and mutable. * Rename interface ExecutionParameters to HasMutableExecutionContext * Rename all "with" extensions for consistency * Add a temporary "compatibility layer" keeping the previous With-ers API available, to ease the transition * Small improvements following review * Make a few fun extensions on HasExecutionContext to be vals instead, for clarity abnd consistency * Update documentation. More doc updates will come later. * Use apply in builders following review suggestion
- Loading branch information
Showing
61 changed files
with
1,218 additions
and
529 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
30 changes: 16 additions & 14 deletions
30
apollo-api/src/commonMain/kotlin/com/apollographql/apollo3/api/http/HttpContext.kt
This file contains 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
4 changes: 2 additions & 2 deletions
4
...i/src/commonMain/kotlin/com/apollographql/apollo3/api/internal/ApolloRequestExtensions.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package com.apollographql.apollo3.api.internal | ||
|
||
import com.apollographql.apollo3.api.CustomScalarAdapters | ||
import com.apollographql.apollo3.api.ExecutionParameters | ||
import com.apollographql.apollo3.api.HasExecutionContext | ||
|
||
val <T> ExecutionParameters<T>.customScalarAdapters: CustomScalarAdapters where T: ExecutionParameters<T> | ||
val HasExecutionContext.customScalarAdapters: CustomScalarAdapters | ||
get() = executionContext[CustomScalarAdapters]!! |
This file contains 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
This file contains 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
Oops, something went wrong.