Created
April 26, 2022 01:21
-
-
Save chandan-0/beeec78aa5e026ccc1e64ab23987f330 to your computer and use it in GitHub Desktop.
Muation is generated in API.Swift
This file contains 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
public final class AddMeasurementMutation: GraphQLMutation { | |
/// The raw GraphQL definition of this operation. | |
public let operationDefinition: String = | |
""" | |
mutation addMeasurement($client_id: String!, $measurementsRequest: ClientMeasurementRequest!) { | |
addMeasurement(client_id: $client_id, measurementsRequest: $measurementsRequest) { | |
__typename | |
id | |
weight | |
weightUnit | |
height | |
heightUnit | |
createdAt | |
} | |
} | |
""" | |
public let operationName: String = "addMeasurement" | |
public var client_id: String | |
public var measurementsRequest: ClientMeasurementRequest | |
public init(client_id: String, measurementsRequest: ClientMeasurementRequest) { | |
self.client_id = client_id | |
self.measurementsRequest = measurementsRequest | |
} | |
public var variables: GraphQLMap? { | |
return ["client_id": client_id, "measurementsRequest": measurementsRequest] | |
} | |
public struct Data: GraphQLSelectionSet { | |
public static let possibleTypes: [String] = ["Mutation"] | |
public static var selections: [GraphQLSelection] { | |
return [ | |
GraphQLField("addMeasurement", arguments: ["client_id": GraphQLVariable("client_id"), "measurementsRequest": GraphQLVariable("measurementsRequest")], type: .nonNull(.object(AddMeasurement.selections))), | |
] | |
} | |
public private(set) var resultMap: ResultMap | |
public init(unsafeResultMap: ResultMap) { | |
self.resultMap = unsafeResultMap | |
} | |
public init(addMeasurement: AddMeasurement) { | |
self.init(unsafeResultMap: ["__typename": "Mutation", "addMeasurement": addMeasurement.resultMap]) | |
} | |
public var addMeasurement: AddMeasurement { | |
get { | |
return AddMeasurement(unsafeResultMap: resultMap["addMeasurement"]! as! ResultMap) | |
} | |
set { | |
resultMap.updateValue(newValue.resultMap, forKey: "addMeasurement") | |
} | |
} | |
public struct AddMeasurement: GraphQLSelectionSet { | |
public static let possibleTypes: [String] = ["Measurement"] | |
public static var selections: [GraphQLSelection] { | |
return [ | |
GraphQLField("__typename", type: .nonNull(.scalar(String.self))), | |
GraphQLField("id", type: .nonNull(.scalar(GraphQLID.self))), | |
GraphQLField("weight", type: .scalar(String.self)), | |
GraphQLField("weightUnit", type: .scalar(String.self)), | |
GraphQLField("height", type: .scalar(String.self)), | |
GraphQLField("heightUnit", type: .scalar(String.self)), | |
GraphQLField("createdAt", type: .scalar(String.self)), | |
] | |
} | |
public private(set) var resultMap: ResultMap | |
public init(unsafeResultMap: ResultMap) { | |
self.resultMap = unsafeResultMap | |
} | |
public init(id: GraphQLID, weight: String? = nil, weightUnit: String? = nil, height: String? = nil, heightUnit: String? = nil, createdAt: String? = nil) { | |
self.init(unsafeResultMap: ["__typename": "Measurement", "id": id, "weight": weight, "weightUnit": weightUnit, "height": height, "heightUnit": heightUnit, "createdAt": createdAt]) | |
} | |
public var __typename: String { | |
get { | |
return resultMap["__typename"]! as! String | |
} | |
set { | |
resultMap.updateValue(newValue, forKey: "__typename") | |
} | |
} | |
public var id: GraphQLID { | |
get { | |
return resultMap["id"]! as! GraphQLID | |
} | |
set { | |
resultMap.updateValue(newValue, forKey: "id") | |
} | |
} | |
public var weight: String? { | |
get { | |
return resultMap["weight"] as? String | |
} | |
set { | |
resultMap.updateValue(newValue, forKey: "weight") | |
} | |
} | |
public var weightUnit: String? { | |
get { | |
return resultMap["weightUnit"] as? String | |
} | |
set { | |
resultMap.updateValue(newValue, forKey: "weightUnit") | |
} | |
} | |
public var height: String? { | |
get { | |
return resultMap["height"] as? String | |
} | |
set { | |
resultMap.updateValue(newValue, forKey: "height") | |
} | |
} | |
public var heightUnit: String? { | |
get { | |
return resultMap["heightUnit"] as? String | |
} | |
set { | |
resultMap.updateValue(newValue, forKey: "heightUnit") | |
} | |
} | |
public var createdAt: String? { | |
get { | |
return resultMap["createdAt"] as? String | |
} | |
set { | |
resultMap.updateValue(newValue, forKey: "createdAt") | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment