Skip to content

Commit e98de65

Browse files
authored
Pretty-print operation manifest (#6720)
1 parent 88e2c59 commit e98de65

File tree

2 files changed

+32
-3
lines changed
  • libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo/compiler
  • tests/integration-tests/testFixtures

2 files changed

+32
-3
lines changed

libraries/apollo-compiler/src/main/kotlin/com/apollographql/apollo/compiler/json.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ fun IrSchema.writeTo(file: File) = (this as DefaultIrSchema).encodeToJson(file)
117117
fun CodegenMetadata.writeTo(file: File) = encodeToJson(file)
118118

119119
@JvmName("writePersistedQueryManifest")
120-
fun PersistedQueryManifest.writeTo(file: File) = encodeToJson(file)
120+
fun PersistedQueryManifest.writeTo(file: File) = file.writeText(prettyPrintJson.encodeToString(this))
121121

122122
@JvmName("writeOperationOutput")
123-
fun OperationOutput.writeTo(file: File) = this.encodeToJson(file)
123+
fun OperationOutput.writeTo(file: File) = file.writeText(prettyPrintJson.encodeToString(this))
124124

125125
fun UsedCoordinates.writeTo(file: File) = file.writeText(prettyPrintJson.encodeToString(this))
Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,30 @@
1-
{"format":"apollo-persisted-query-manifest","version":1,"operations":[{"id":"7b597dfc22b044880da8ddea282fd3cdc414972fecc42673e01870f2c2a83873","body":"mutation MultipleUpload($files: [Upload!]!) { multipleUpload(files: $files) { id path filename mimetype } }","name":"MultipleUpload","type":"mutation"},{"id":"debf75d1c1580dc06d3deb37daaa1439cbc0aeef776e2cb836d2720ca9b2761e","body":"mutation NestedUpload($topFile: Upload, $topFileList: [Upload], $nested: NestedObject) { nestedUpload(topFile: $topFile, topFileList: $topFileList, nested: $nested) }","name":"NestedUpload","type":"mutation"},{"id":"99c2bd8836d69bb361489392d1bcf2897780c9d5f653b7ab87d6a5c88a3b14fc","body":"mutation SingleUpload($file: Upload!) { singleUpload(file: $file) { id path filename mimetype } }","name":"SingleUpload","type":"mutation"},{"id":"bd822d287b6428f2d9135349edbd3a2997ca9ec8ed433c1b9a078d3cf2f70eae","body":"mutation SingleUploadTwice($file1: Upload!, $file2: Upload!) { file1: singleUpload(file: $file1) { id path filename mimetype } file2: singleUpload(file: $file2) { id path filename mimetype } }","name":"SingleUploadTwice","type":"mutation"}]}
1+
{
2+
"format": "apollo-persisted-query-manifest",
3+
"version": 1,
4+
"operations": [
5+
{
6+
"id": "7b597dfc22b044880da8ddea282fd3cdc414972fecc42673e01870f2c2a83873",
7+
"body": "mutation MultipleUpload($files: [Upload!]!) { multipleUpload(files: $files) { id path filename mimetype } }",
8+
"name": "MultipleUpload",
9+
"type": "mutation"
10+
},
11+
{
12+
"id": "debf75d1c1580dc06d3deb37daaa1439cbc0aeef776e2cb836d2720ca9b2761e",
13+
"body": "mutation NestedUpload($topFile: Upload, $topFileList: [Upload], $nested: NestedObject) { nestedUpload(topFile: $topFile, topFileList: $topFileList, nested: $nested) }",
14+
"name": "NestedUpload",
15+
"type": "mutation"
16+
},
17+
{
18+
"id": "99c2bd8836d69bb361489392d1bcf2897780c9d5f653b7ab87d6a5c88a3b14fc",
19+
"body": "mutation SingleUpload($file: Upload!) { singleUpload(file: $file) { id path filename mimetype } }",
20+
"name": "SingleUpload",
21+
"type": "mutation"
22+
},
23+
{
24+
"id": "bd822d287b6428f2d9135349edbd3a2997ca9ec8ed433c1b9a078d3cf2f70eae",
25+
"body": "mutation SingleUploadTwice($file1: Upload!, $file2: Upload!) { file1: singleUpload(file: $file1) { id path filename mimetype } file2: singleUpload(file: $file2) { id path filename mimetype } }",
26+
"name": "SingleUploadTwice",
27+
"type": "mutation"
28+
}
29+
]
30+
}

0 commit comments

Comments
 (0)