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
+31-18Lines changed: 31 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,24 @@ import okio.buffer
5
5
importokio.sink
6
6
importjava.io.File
7
7
8
-
fun IntrospectionSchema.toSDL(file:File) {
8
+
/**
9
+
* Previous versions of this method used to encode defaultValues as Json elements. For an example:
10
+
* "defaultValue": [0, 1]
11
+
*
12
+
* This is wrong. The spec mandates defaultValue to be GraphQL encoded String:
13
+
* "defaultValue": "[0, 1]"
14
+
*
15
+
* For backward compatibility, use [legacyDefaultValues] = true
16
+
*/
17
+
fun IntrospectionSchema.toSDL(file:File, legacyDefaultValues:Boolean) {
9
18
file.sink().buffer().use {
10
-
toSDL(it)
19
+
toSDL(it, legacyDefaultValues)
11
20
}
12
21
}
13
22
14
-
fun IntrospectionSchema.toSDL(sink:BufferedSink) {
23
+
fun IntrospectionSchema.toSDL(file:File) = toSDL(file, true)
24
+
25
+
fun IntrospectionSchema.toSDL(sink:BufferedSink, legacyDefaultValues:Boolean) {
Copy file name to clipboardExpand all lines: apollo-gradle-plugin/src/main/kotlin/com/apollographql/apollo/gradle/internal/ApolloDownloadSchemaCliTask.kt
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -176,7 +176,7 @@ abstract class ApolloDownloadSchemaCliTask : DefaultTask() {
0 commit comments