Skip to content

Instantly share code, notes, and snippets.

@handshake-engineering-blog
Last active April 22, 2021 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save handshake-engineering-blog/7a17b8d94e44d7fa368c97b8693157c4 to your computer and use it in GitHub Desktop.
Save handshake-engineering-blog/7a17b8d94e44d7fa368c97b8693157c4 to your computer and use it in GitHub Desktop.
1801584810_1
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