@@ -4,7 +4,7 @@ import NIO
4
4
/**
5
5
* These are all of the possible kinds of types.
6
6
*/
7
- public protocol GraphQLType : CustomDebugStringConvertible , Encodable , KeySubscriptable , AnyObject , Equatable { }
7
+ public protocol GraphQLType : CustomDebugStringConvertible , Encodable , KeySubscriptable , AnyObject { }
8
8
extension GraphQLScalarType : GraphQLType { }
9
9
extension GraphQLObjectType : GraphQLType { }
10
10
extension GraphQLInterfaceType : GraphQLType { }
@@ -14,12 +14,6 @@ extension GraphQLInputObjectType : GraphQLType {}
14
14
extension GraphQLList : GraphQLType { }
15
15
extension GraphQLNonNull : GraphQLType { }
16
16
17
- extension GraphQLType {
18
- public static func == ( lhs: Self , rhs: Self ) -> Bool {
19
- ObjectIdentifier ( lhs) == ObjectIdentifier ( rhs)
20
- }
21
- }
22
-
23
17
/**
24
18
* These types may be used as input types for arguments and directives.
25
19
*/
@@ -120,10 +114,20 @@ func getNullableType(type: (any GraphQLType)?) -> (any GraphQLNullableType)? {
120
114
/**
121
115
* These named types do not include modifiers like List or NonNull.
122
116
*/
123
- public protocol GraphQLNamedType : GraphQLNullableType {
117
+ public protocol GraphQLNamedType : GraphQLNullableType , Hashable {
124
118
var name : String { get }
125
119
}
126
120
121
+ extension GraphQLNamedType {
122
+ public static func == ( lhs: Self , rhs: Self ) -> Bool {
123
+ lhs. name == rhs. name
124
+ }
125
+
126
+ public func hash( into hasher: inout Hasher ) {
127
+ name. hash ( into: & hasher)
128
+ }
129
+ }
130
+
127
131
extension GraphQLScalarType : GraphQLNamedType { }
128
132
extension GraphQLObjectType : GraphQLNamedType { }
129
133
extension GraphQLInterfaceType : GraphQLNamedType { }
0 commit comments