-
Notifications
You must be signed in to change notification settings - Fork 739
/
Copy pathLocalCacheMutation.swift
47 lines (38 loc) · 1.32 KB
/
LocalCacheMutation.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
public protocol LocalCacheMutation: AnyObject, Hashable {
static var operationType: GraphQLOperationType { get }
var __variables: GraphQLOperation.Variables? { get }
associatedtype Data: MutableRootSelectionSet
}
public extension LocalCacheMutation {
var __variables: GraphQLOperation.Variables? {
return nil
}
func hash(into hasher: inout Hasher) {
hasher.combine(__variables?._jsonEncodableValue?._jsonValue)
}
static func ==(lhs: Self, rhs: Self) -> Bool {
lhs.__variables?._jsonEncodableValue?._jsonValue == rhs.__variables?._jsonEncodableValue?._jsonValue
}
}
public protocol MutableSelectionSet: SelectionSet {
var __data: DataDict { get set }
}
public extension MutableSelectionSet {
@inlinable var __typename: String? {
get { __data["__typename"] }
set { __data["__typename"] = newValue }
}
}
public extension MutableSelectionSet where Fragments: FragmentContainer {
@inlinable var fragments: Fragments {
get { Self.Fragments(_dataDict: __data) }
_modify {
var f = Self.Fragments(_dataDict: __data)
yield &f
self.__data._data = f.__data._data
}
@available(*, unavailable, message: "mutate properties of the fragment instead.")
set { preconditionFailure("") }
}
}
public protocol MutableRootSelectionSet: RootSelectionSet, MutableSelectionSet {}