@@ -4,7 +4,7 @@ import NIO
44/**
55 * These are all of the possible kinds of types.
66 */
7- public protocol GraphQLType : CustomDebugStringConvertible , Encodable , KeySubscriptable , AnyObject , Equatable { }
7+ public protocol GraphQLType : CustomDebugStringConvertible , Encodable , KeySubscriptable , AnyObject { }
88extension GraphQLScalarType : GraphQLType { }
99extension GraphQLObjectType : GraphQLType { }
1010extension GraphQLInterfaceType : GraphQLType { }
@@ -14,12 +14,6 @@ extension GraphQLInputObjectType : GraphQLType {}
1414extension GraphQLList : GraphQLType { }
1515extension GraphQLNonNull : GraphQLType { }
1616
17- extension GraphQLType {
18- public static func == ( lhs: Self , rhs: Self ) -> Bool {
19- ObjectIdentifier ( lhs) == ObjectIdentifier ( rhs)
20- }
21- }
22-
2317/**
2418 * These types may be used as input types for arguments and directives.
2519 */
@@ -120,10 +114,20 @@ func getNullableType(type: (any GraphQLType)?) -> (any GraphQLNullableType)? {
120114/**
121115 * These named types do not include modifiers like List or NonNull.
122116 */
123- public protocol GraphQLNamedType : GraphQLNullableType {
117+ public protocol GraphQLNamedType : GraphQLNullableType , Hashable {
124118 var name : String { get }
125119}
126120
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+
127131extension GraphQLScalarType : GraphQLNamedType { }
128132extension GraphQLObjectType : GraphQLNamedType { }
129133extension GraphQLInterfaceType : GraphQLNamedType { }
0 commit comments