1+ import Foundation
12import NIO
23
34/**
@@ -666,7 +667,7 @@ public struct GraphQLArgument {
666667public struct GraphQLArgumentDefinition {
667668 public let name : String
668669 public let type : GraphQLInputType
669- public let defaultValue : Map ?
670+ public let defaultValue : String ?
670671 public let description : String ?
671672
672673 init (
@@ -677,7 +678,14 @@ public struct GraphQLArgumentDefinition {
677678 ) {
678679 self . name = name
679680 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+
681689 self . description = description
682690 }
683691}
@@ -1253,12 +1261,19 @@ func defineInputObjectFieldMap(
12531261
12541262public struct InputObjectField {
12551263 public let type : GraphQLInputType
1256- public let defaultValue : Map ?
1264+ public let defaultValue : String ?
12571265 public let description : String ?
12581266
12591267 public init ( type: GraphQLInputType , defaultValue: Map ? = nil , description: String ? = nil ) {
12601268 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+
12621277 self . description = description
12631278 }
12641279}
@@ -1269,7 +1284,7 @@ public struct InputObjectFieldDefinition {
12691284 public let name : String
12701285 public let description : String ?
12711286 public let type : GraphQLInputType
1272- public let defaultValue : Map ?
1287+ public let defaultValue : String ?
12731288}
12741289
12751290extension InputObjectFieldDefinition : Encodable {
0 commit comments