Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Update to Apollo 2.0.4#10
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
5eb6c6127cc4cce1d94a9451537d378811aFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import Foundation | ||
| /// Configuration for initializing a GraphQL API adapter. | ||
| /// | ||
| /// Use this struct to configure the GraphQL client with endpoint URL, | ||
| /// session configuration, default headers, and network observers. | ||
| public struct GraphQLAPIConfiguration: Sendable { | ||
| /// The GraphQL endpoint URL. | ||
| public let url: URL | ||
| /// URL session configuration. Defaults to `.default`. | ||
| public let urlSessionConfiguration: URLSessionConfiguration | ||
| /// Headers to include in every request. | ||
| public let defaultHeaders: [String: String] | ||
| /// Network observers for monitoring requests (logging, analytics, etc.). | ||
| public let networkObservers: [any GraphQLNetworkObserver] | ||
| /// Creates a new GraphQL API configuration. | ||
| /// | ||
| /// - Parameters: | ||
| /// - url: The GraphQL endpoint URL. | ||
| /// - urlSessionConfiguration: URL session configuration. Defaults to `.default`. | ||
| /// - defaultHeaders: Headers to include in every request. Defaults to empty. | ||
| /// - networkObservers: Network observers for monitoring requests. Defaults to empty. | ||
| public init( | ||
| url: URL, | ||
| urlSessionConfiguration: URLSessionConfiguration = .default, | ||
| defaultHeaders: [String: String] = [:], | ||
| networkObservers: [any GraphQLNetworkObserver] = [] | ||
| ) { | ||
| self.url = url | ||
| self.urlSessionConfiguration = urlSessionConfiguration | ||
| self.defaultHeaders = defaultHeaders | ||
| self.networkObservers = networkObservers | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import Foundation | ||
| /// Base protocol for GraphQL operation configurations. | ||
| /// | ||
| /// Defines common options shared across all GraphQL operations (queries, mutations, subscriptions). | ||
| public protocol GraphQLOperationConfiguration: Sendable { | ||
| /// Additional headers to add to the request. | ||
| var headers: RequestHeaders? { get } | ||
| } | ||
| /// Configuration for GraphQL queries and mutations. | ||
| /// | ||
| /// Use this struct to customize request-specific options like additional headers. | ||
| public struct GraphQLRequestConfiguration: GraphQLOperationConfiguration { | ||
| /// Additional headers to add to the request. | ||
| public let headers: RequestHeaders? | ||
| /// Creates a new request configuration. | ||
| /// | ||
| /// - Parameter headers: Additional headers to add to the request. Defaults to `nil`. | ||
| public init(headers: RequestHeaders? = nil) { | ||
| self.headers = headers | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import Apollo | ||
| struct ApolloError: Error { | ||
| struct ApolloError: Error, Sendable { | ||
| let errors: [Apollo.GraphQLError] | ||
| } |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.