1
+ import Foundation
1
2
import NIO
2
3
3
4
/**
@@ -666,7 +667,7 @@ public struct GraphQLArgument {
666
667
public struct GraphQLArgumentDefinition {
667
668
public let name : String
668
669
public let type : GraphQLInputType
669
- public let defaultValue : Map ?
670
+ public let defaultValue : String ?
670
671
public let description : String ?
671
672
672
673
init (
@@ -677,7 +678,14 @@ public struct GraphQLArgumentDefinition {
677
678
) {
678
679
self . name = name
679
680
self . type = type
680
- self . defaultValue = defaultValue
681
+
682
+ self . defaultValue = try ? defaultValue. flatMap {
683
+ String (
684
+ data: try JSONEncoder ( ) . encode ( $0) ,
685
+ encoding: . utf8
686
+ )
687
+ }
688
+
681
689
self . description = description
682
690
}
683
691
}
@@ -1253,12 +1261,19 @@ func defineInputObjectFieldMap(
1253
1261
1254
1262
public struct InputObjectField {
1255
1263
public let type : GraphQLInputType
1256
- public let defaultValue : Map ?
1264
+ public let defaultValue : String ?
1257
1265
public let description : String ?
1258
1266
1259
1267
public init ( type: GraphQLInputType , defaultValue: Map ? = nil , description: String ? = nil ) {
1260
1268
self . type = type
1261
- self . defaultValue = defaultValue
1269
+
1270
+ self . defaultValue = try ? defaultValue. flatMap {
1271
+ String (
1272
+ data: try JSONEncoder ( ) . encode ( $0) ,
1273
+ encoding: . utf8
1274
+ )
1275
+ }
1276
+
1262
1277
self . description = description
1263
1278
}
1264
1279
}
@@ -1269,7 +1284,7 @@ public struct InputObjectFieldDefinition {
1269
1284
public let name : String
1270
1285
public let description : String ?
1271
1286
public let type : GraphQLInputType
1272
- public let defaultValue : Map ?
1287
+ public let defaultValue : String ?
1273
1288
}
1274
1289
1275
1290
extension InputObjectFieldDefinition : Encodable {
0 commit comments