Skip to content

Instantly share code, notes, and snippets.

@arvindravi
Created December 9, 2016 12:49
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 arvindravi/d5ea8609f00ca7e6ba2b5912c06dca81 to your computer and use it in GitHub Desktop.
Save arvindravi/d5ea8609f00ca7e6ba2b5912c06dca81 to your computer and use it in GitHub Desktop.
// This file was automatically generated and should not be edited.
import Apollo
/// Autogenerated input type of CreateUserMutation
public struct CreateUserMutationInput: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init() {
}
public init(userInput: UserInput?) {
graphQLMap = ["userInput": userInput]
}
public init(clientMutationId: String?) {
graphQLMap = ["clientMutationId": clientMutationId]
}
public init(clientMutationId: String?, userInput: UserInput?) {
graphQLMap = ["clientMutationId": clientMutationId, "userInput": userInput]
}
}
public struct UserInput: GraphQLMapConvertible {
public var graphQLMap: GraphQLMap
public init(name: String, uid: Int, provider: String) {
graphQLMap = ["name": name, "uid": uid, "provider": provider]
}
}
public final class ActivityQuery: GraphQLQuery {
public static let operationDefinition =
"query activity($id: ID!) {" +
" activity(id: $id) {" +
" category" +
" }" +
"}"
public let id: GraphQLID
public init(id: GraphQLID) {
self.id = id
}
public var variables: GraphQLMap? {
return ["id": id]
}
public struct Data: GraphQLMappable {
public let activity: Activity?
public init(reader: GraphQLResultReader) throws {
activity = try reader.optionalValue(for: Field(responseName: "activity"))
}
public struct Activity: GraphQLMappable {
public let __typename = "Activity"
public let category: String?
public init(reader: GraphQLResultReader) throws {
category = try reader.optionalValue(for: Field(responseName: "category"))
}
}
}
}
public final class CreateUserMutation: GraphQLMutation {
public static let operationDefinition =
"mutation CreateUser($input: CreateUserMutationInput!) {" +
" createUser(input: $input) {" +
" clientMutationId" +
" user {" +
" name" +
" }" +
" }" +
"}"
public let input: CreateUserMutationInput
public init(input: CreateUserMutationInput) {
self.input = input
}
public var variables: GraphQLMap? {
return ["input": input]
}
public struct Data: GraphQLMappable {
public let createUser: CreateUser?
public init(reader: GraphQLResultReader) throws {
createUser = try reader.optionalValue(for: Field(responseName: "createUser"))
}
public struct CreateUser: GraphQLMappable {
public let __typename = "CreateUserMutationPayload"
public let clientMutationId: String?
public let user: User?
public init(reader: GraphQLResultReader) throws {
clientMutationId = try reader.optionalValue(for: Field(responseName: "clientMutationId"))
user = try reader.optionalValue(for: Field(responseName: "user"))
}
public struct User: GraphQLMappable {
public let __typename = "User"
public let name: String?
public init(reader: GraphQLResultReader) throws {
name = try reader.optionalValue(for: Field(responseName: "name"))
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment