Skip to content

Commit f5ca0e4

Browse files
committed
fix(graphql-types-generator): indentation fixes
1 parent 6204066 commit f5ca0e4

File tree

5 files changed

+24
-49
lines changed

5 files changed

+24
-49
lines changed

packages/graphql-types-generator/test/compiler/legacyIR.js

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -899,8 +899,7 @@ describe('Compiling query documents to the legacy IR', () => {
899899
hero {
900900
name
901901
}
902-
}
903-
`;
902+
}`;
904903
const document = parse(source);
905904

906905
const { operations } = compileToLegacyIR(schema, document);
@@ -912,8 +911,7 @@ describe('Compiling query documents to the legacy IR', () => {
912911
const source = stripIndent`
913912
fragment HeroDetails on Character {
914913
name
915-
}
916-
`;
914+
}`;
917915
const document = parse(source);
918916

919917
const { fragments } = compileToLegacyIR(schema, document);
@@ -927,8 +925,7 @@ describe('Compiling query documents to the legacy IR', () => {
927925
hero {
928926
name
929927
}
930-
}
931-
`;
928+
}`;
932929
const document = parse(source);
933930

934931
const { operations } = compileToLegacyIR(schema, document, { addTypename: true });
@@ -939,16 +936,14 @@ describe('Compiling query documents to the legacy IR', () => {
939936
__typename
940937
name
941938
}
942-
}
943-
`);
939+
}`);
944940
});
945941

946942
it(`should include the source of fragments with __typename added when addTypename is true`, () => {
947943
const source = stripIndent`
948944
fragment HeroDetails on Character {
949945
name
950-
}
951-
`;
946+
}`;
952947
const document = parse(source);
953948

954949
const { fragments } = compileToLegacyIR(schema, document, { addTypename: true });
@@ -957,8 +952,7 @@ describe('Compiling query documents to the legacy IR', () => {
957952
fragment HeroDetails on Character {
958953
__typename
959954
name
960-
}
961-
`);
955+
}`);
962956
});
963957

964958
it(`should include the operationType for a query`, () => {
@@ -967,8 +961,7 @@ describe('Compiling query documents to the legacy IR', () => {
967961
hero {
968962
name
969963
}
970-
}
971-
`;
964+
}`;
972965
const document = parse(source);
973966

974967
const { operations } = compileToLegacyIR(schema, document);
@@ -983,8 +976,7 @@ describe('Compiling query documents to the legacy IR', () => {
983976
stars
984977
commentary
985978
}
986-
}
987-
`;
979+
}`;
988980
const document = parse(source);
989981

990982
const { operations } = compileToLegacyIR(schema, document);

packages/graphql-types-generator/test/compiler/visitors/generateOperationId.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ describe(`generateOperationId()`, () => {
1313
}
1414
fragment HeroDetails on Character {
1515
name
16-
}
17-
`);
16+
}`);
1817

1918
const { operationId: id1 } = generateOperationId(context1.operations['Hero'], context1.fragments);
2019

@@ -26,8 +25,7 @@ describe(`generateOperationId()`, () => {
2625
}
2726
fragment HeroDetails on Character {
2827
appearsIn
29-
}
30-
`);
28+
}`);
3129

3230
const { operationId: id2 } = generateOperationId(context2.operations['Hero'], context2.fragments);
3331

@@ -40,16 +38,14 @@ describe(`generateOperationId()`, () => {
4038
hero(episode: $episode) {
4139
name
4240
}
43-
}
44-
`);
41+
}`);
4542

4643
const { operationId: id1 } = generateOperationId(context1.operations['HeroName'], context1.fragments);
4744

4845
const context2 = compile(`
4946
# Profound comment
5047
query HeroName($episode:Episode) { hero(episode: $episode) { name } }
51-
# Deeply meaningful comment
52-
`);
48+
# Deeply meaningful comment`);
5349

5450
const { operationId: id2 } = generateOperationId(context2.operations['HeroName'], context2.fragments);
5551

@@ -69,8 +65,7 @@ describe(`generateOperationId()`, () => {
6965
}
7066
fragment HeroAppearsIn on Character {
7167
appearsIn
72-
}
73-
`);
68+
}`);
7469

7570
const { operationId: id1 } = generateOperationId(context1.operations['Hero'], context1.fragments);
7671

@@ -86,8 +81,7 @@ describe(`generateOperationId()`, () => {
8681
}
8782
fragment HeroName on Character {
8883
name
89-
}
90-
`);
84+
}`);
9185

9286
const { operationId: id2 } = generateOperationId(context2.operations['Hero'], context2.fragments);
9387

@@ -107,8 +101,7 @@ describe(`generateOperationId()`, () => {
107101
fragment HeroDetails on Character {
108102
...HeroName
109103
appearsIn
110-
}
111-
`);
104+
}`);
112105

113106
const { sourceWithFragments } = generateOperationId(context.operations['Hero'], context.fragments);
114107

@@ -124,7 +117,6 @@ describe(`generateOperationId()`, () => {
124117
}
125118
fragment HeroName on Character {
126119
name
127-
}
128-
`);
120+
}`);
129121
});
130122
});

packages/graphql-types-generator/test/loading.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ describe('Validation', () => {
1616
loadAndMergeQueryDocuments(inputPaths);
1717
}).toThrowError(
1818
`Could not parse graphql operations in ${path.join(
19-
'test',
2019
'fixtures',
2120
'misc',
2221
'invalid-gqlQueries.js',

packages/graphql-types-generator/test/scala/language.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ describe('Scala code generation: Basic language constructs', function() {
2323
}
2424
val age: Int = {
2525
}
26-
}
27-
`);
26+
}`);
2827
});
2928

3029
test(`should generate a case class declaration`, function() {
@@ -36,8 +35,7 @@ describe('Scala code generation: Basic language constructs', function() {
3635

3736
expect(generator.output).toBe(stripIndent`
3837
case class Hero(name: String, age: Int) {
39-
}
40-
`);
38+
}`);
4139
});
4240

4341
test(`should generate nested case class declarations`, function() {
@@ -53,8 +51,7 @@ describe('Scala code generation: Basic language constructs', function() {
5351
case class Hero(name: String, age: Int) {
5452
case class Friend(name: String) {
5553
}
56-
}
57-
`);
54+
}`);
5855
});
5956

6057
test(`should handle multi-line descriptions`, () => {

packages/graphql-types-generator/test/swift/language.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ describe('Swift code generation: Basic language constructs', () => {
1919
public final class Hero {
2020
public var name: String
2121
public var age: Int
22-
}
23-
`);
22+
}`);
2423
});
2524

2625
it(`should generate a struct declaration`, () => {
@@ -33,8 +32,7 @@ describe('Swift code generation: Basic language constructs', () => {
3332
public struct Hero {
3433
public var name: String
3534
public var age: Int
36-
}
37-
`);
35+
}`);
3836
});
3937

4038
it(`should generate an escaped struct declaration`, () => {
@@ -47,8 +45,7 @@ describe('Swift code generation: Basic language constructs', () => {
4745
public struct \`Type\` {
4846
public var name: String
4947
public var yearOfBirth: Int
50-
}
51-
`);
48+
}`);
5249
});
5350

5451
it(`should generate nested struct declarations`, () => {
@@ -69,8 +66,7 @@ describe('Swift code generation: Basic language constructs', () => {
6966
public struct Friend {
7067
public var name: String
7168
}
72-
}
73-
`);
69+
}`);
7470
});
7571

7672
it(`should generate a protocol declaration`, () => {
@@ -83,8 +79,7 @@ describe('Swift code generation: Basic language constructs', () => {
8379
public protocol HeroDetails: HasName {
8480
var name: String { get }
8581
var age: Int { get }
86-
}
87-
`);
82+
}`);
8883
});
8984

9085
it(`should handle multi-line descriptions`, () => {

0 commit comments

Comments
 (0)