Skip to content

Instantly share code, notes, and snippets.

@navsing
Created April 12, 2020 00:19
Show Gist options
  • Save navsing/74a8a10ffb0ef9d29c1a27a74b816839 to your computer and use it in GitHub Desktop.
Save navsing/74a8a10ffb0ef9d29c1a27a74b816839 to your computer and use it in GitHub Desktop.
import Foundation
import Apollo
class Network {
static let shared = Network()
let apollo: ApolloClient = {
let configuration = URLSessionConfiguration.default
configuration.httpAdditionalHeaders = [
"x-api-key": "da2-tbx2kgzvp5bmlo4jxzhriavg3i"
]
let url = URL(string: "https://zopcxyayyzd77hm6kvinizukhu.appsync-api.us-east-1.amazonaws.com/graphql")!
return ApolloClient(
networkTransport: HTTPNetworkTransport( url: url, session: URLSession(configuration: configuration))
)
}()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment