Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
protocol Query {
/// The format of the response to expect from the GraphQL request
associatedtype Response: Decodable
/// The full string to send in the GraphQL request
var body: String { get }
Decode a `Data` object from the GraphQL endpoint into our expected `Response` type.
- Parameter data: `Data` - bytes from the network
static func decodeResponse(_ data: Data) throws -> Response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment