Created
April 12, 2020 00:19
-
-
Save navsing/74a8a10ffb0ef9d29c1a27a74b816839 to your computer and use it in GitHub Desktop.
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
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