You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apollo-compiler/src/main/kotlin/com/apollographql/apollo/compiler/parser/introspection/introspection2sdl.kt
+15-2Lines changed: 15 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -137,7 +137,14 @@ private fun IntrospectionSchema.InputField.toSDL(sink: BufferedSink) {
137
137
sink.writeUtf8("$name: ${type.asGraphQLType()}")
138
138
if (defaultValue !=null) {
139
139
sink.writeUtf8(" = ")
140
-
sink.writeValue(defaultValue)
140
+
if (defaultValue isString) {
141
+
// defaultValue is already encoded as GraphQL, we can pass it verbatim
142
+
sink.writeUtf8(defaultValue)
143
+
} else {
144
+
// legacy mode if we bump into an introspection schema that doesn't encode the default value
0 commit comments