diff --git a/package.json b/package.json index 15112ee2c8..28161a728a 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,6 @@ "flow-bin": "0.111.3", "mocha": "6.2.2", "nyc": "14.1.1", - "prettier": "1.18.2" + "prettier": "1.19.1" } } diff --git a/src/language/__tests__/schema-parser-test.js b/src/language/__tests__/schema-parser-test.js index 9abcc05d21..2a6a73a5bd 100644 --- a/src/language/__tests__/schema-parser-test.js +++ b/src/language/__tests__/schema-parser-test.js @@ -1077,12 +1077,11 @@ input Hello { }); const doc = parse(body, { allowLegacySDLImplementsInterfaces: true }); - expect(toJSONDeep(doc)).to.have.deep.nested.property( - 'definitions[0].interfaces', - [ - typeNode('Wo', { start: 22, end: 24 }), - typeNode('rld', { start: 25, end: 28 }), - ], - ); + expect( + toJSONDeep(doc), + ).to.have.deep.nested.property('definitions[0].interfaces', [ + typeNode('Wo', { start: 22, end: 24 }), + typeNode('rld', { start: 25, end: 28 }), + ]); }); }); diff --git a/src/subscription/__tests__/mapAsyncIterator-test.js b/src/subscription/__tests__/mapAsyncIterator-test.js index 3821917970..7ecfa3353f 100644 --- a/src/subscription/__tests__/mapAsyncIterator-test.js +++ b/src/subscription/__tests__/mapAsyncIterator-test.js @@ -200,7 +200,11 @@ describe('mapAsyncIterator', () => { throw new Error('Goodbye'); } - const doubles = mapAsyncIterator(source(), x => x + x, error => error); + const doubles = mapAsyncIterator( + source(), + x => x + x, + error => error, + ); expect(await doubles.next()).to.deep.equal({ value: 'HelloHello', diff --git a/src/type/__tests__/enumType-test.js b/src/type/__tests__/enumType-test.js index 0b87bb45c6..d2d1acc041 100644 --- a/src/type/__tests__/enumType-test.js +++ b/src/type/__tests__/enumType-test.js @@ -279,7 +279,10 @@ describe('Type System: Enum Values', () => { { message: 'Variable "$color" of type "String!" used in position expecting type "Color".', - locations: [{ line: 1, column: 8 }, { line: 1, column: 47 }], + locations: [ + { line: 1, column: 8 }, + { line: 1, column: 47 }, + ], }, ], }); @@ -294,7 +297,10 @@ describe('Type System: Enum Values', () => { { message: 'Variable "$color" of type "Int!" used in position expecting type "Color".', - locations: [{ line: 1, column: 8 }, { line: 1, column: 44 }], + locations: [ + { line: 1, column: 8 }, + { line: 1, column: 44 }, + ], }, ], }); diff --git a/src/type/__tests__/validation-test.js b/src/type/__tests__/validation-test.js index 4f9ee18f2c..39e92d9c0d 100644 --- a/src/type/__tests__/validation-test.js +++ b/src/type/__tests__/validation-test.js @@ -548,7 +548,10 @@ describe('Type System: Union types must be valid', () => { expect(validateSchema(schema)).to.deep.equal([ { message: 'Union type BadUnion must define one or more member types.', - locations: [{ line: 6, column: 7 }, { line: 4, column: 9 }], + locations: [ + { line: 6, column: 7 }, + { line: 4, column: 9 }, + ], }, ]); }); @@ -576,7 +579,10 @@ describe('Type System: Union types must be valid', () => { expect(validateSchema(schema)).to.deep.equal([ { message: 'Union type BadUnion can only include type TypeA once.', - locations: [{ line: 15, column: 11 }, { line: 17, column: 11 }], + locations: [ + { line: 15, column: 11 }, + { line: 17, column: 11 }, + ], }, ]); @@ -585,11 +591,17 @@ describe('Type System: Union types must be valid', () => { expect(validateSchema(schema)).to.deep.equal([ { message: 'Union type BadUnion can only include type TypeA once.', - locations: [{ line: 15, column: 11 }, { line: 17, column: 11 }], + locations: [ + { line: 15, column: 11 }, + { line: 17, column: 11 }, + ], }, { message: 'Union type BadUnion can only include type TypeB once.', - locations: [{ line: 16, column: 11 }, { line: 1, column: 25 }], + locations: [ + { line: 16, column: 11 }, + { line: 1, column: 25 }, + ], }, ]); }); @@ -692,7 +704,10 @@ describe('Type System: Input Objects must have fields', () => { { message: 'Input Object type SomeInputObject must define one or more fields.', - locations: [{ line: 6, column: 7 }, { line: 4, column: 9 }], + locations: [ + { line: 6, column: 7 }, + { line: 4, column: 9 }, + ], }, ]); }); @@ -796,12 +811,18 @@ describe('Type System: Input Objects must have fields', () => { { message: 'Cannot reference Input Object "SomeInputObject" within itself through a series of non-null fields: "startLoop.closeLoop".', - locations: [{ line: 7, column: 9 }, { line: 11, column: 9 }], + locations: [ + { line: 7, column: 9 }, + { line: 11, column: 9 }, + ], }, { message: 'Cannot reference Input Object "AnotherInputObject" within itself through a series of non-null fields: "startSecondLoop.closeSecondLoop".', - locations: [{ line: 12, column: 9 }, { line: 16, column: 9 }], + locations: [ + { line: 12, column: 9 }, + { line: 16, column: 9 }, + ], }, { message: @@ -866,7 +887,10 @@ describe('Type System: Enum types must be well defined', () => { expect(validateSchema(schema)).to.deep.equal([ { message: 'Enum type SomeEnum must define one or more values.', - locations: [{ line: 6, column: 7 }, { line: 4, column: 9 }], + locations: [ + { line: 6, column: 7 }, + { line: 4, column: 9 }, + ], }, ]); }); @@ -1067,7 +1091,10 @@ describe('Type System: Objects can only implement unique interfaces', () => { expect(validateSchema(schema)).to.deep.equal([ { message: 'Type AnotherObject can only implement AnotherInterface once.', - locations: [{ line: 10, column: 37 }, { line: 10, column: 56 }], + locations: [ + { line: 10, column: 37 }, + { line: 10, column: 56 }, + ], }, ]); }); @@ -1093,7 +1120,10 @@ describe('Type System: Objects can only implement unique interfaces', () => { expect(validateSchema(extendedSchema)).to.deep.equal([ { message: 'Type AnotherObject can only implement AnotherInterface once.', - locations: [{ line: 10, column: 37 }, { line: 1, column: 38 }], + locations: [ + { line: 10, column: 37 }, + { line: 1, column: 38 }, + ], }, ]); }); @@ -1169,7 +1199,10 @@ describe('Type System: Interface extensions should be valid', () => { { message: 'Interface field argument AnotherInterface.newField(test:) expected but AnotherObject.newField does not provide it.', - locations: [{ line: 3, column: 20 }, { line: 7, column: 11 }], + locations: [ + { line: 3, column: 20 }, + { line: 7, column: 11 }, + ], }, ]); }); @@ -1217,7 +1250,10 @@ describe('Type System: Interface extensions should be valid', () => { { message: 'Interface field AnotherInterface.newInterfaceField expects type NewInterface but AnotherObject.newInterfaceField is type MismatchingInterface.', - locations: [{ line: 3, column: 30 }, { line: 15, column: 30 }], + locations: [ + { line: 3, column: 30 }, + { line: 15, column: 30 }, + ], }, ]); }); @@ -1609,7 +1645,10 @@ describe('Objects must adhere to Interface they implement', () => { { message: 'Interface field AnotherInterface.field expected but AnotherObject does not provide it.', - locations: [{ line: 7, column: 9 }, { line: 10, column: 7 }], + locations: [ + { line: 7, column: 9 }, + { line: 10, column: 7 }, + ], }, ]); }); @@ -1632,7 +1671,10 @@ describe('Objects must adhere to Interface they implement', () => { { message: 'Interface field AnotherInterface.field expects type String but AnotherObject.field is type Int.', - locations: [{ line: 7, column: 31 }, { line: 11, column: 31 }], + locations: [ + { line: 7, column: 31 }, + { line: 11, column: 31 }, + ], }, ]); }); @@ -1658,7 +1700,10 @@ describe('Objects must adhere to Interface they implement', () => { { message: 'Interface field AnotherInterface.field expects type A but AnotherObject.field is type B.', - locations: [{ line: 10, column: 16 }, { line: 14, column: 16 }], + locations: [ + { line: 10, column: 16 }, + { line: 14, column: 16 }, + ], }, ]); }); @@ -1721,7 +1766,10 @@ describe('Objects must adhere to Interface they implement', () => { { message: 'Interface field argument AnotherInterface.field(input:) expected but AnotherObject.field does not provide it.', - locations: [{ line: 7, column: 15 }, { line: 11, column: 9 }], + locations: [ + { line: 7, column: 15 }, + { line: 11, column: 9 }, + ], }, ]); }); @@ -1744,7 +1792,10 @@ describe('Objects must adhere to Interface they implement', () => { { message: 'Interface field argument AnotherInterface.field(input:) expects type String but AnotherObject.field(input:) is type Int.', - locations: [{ line: 7, column: 22 }, { line: 11, column: 22 }], + locations: [ + { line: 7, column: 22 }, + { line: 11, column: 22 }, + ], }, ]); }); @@ -1767,12 +1818,18 @@ describe('Objects must adhere to Interface they implement', () => { { message: 'Interface field AnotherInterface.field expects type String but AnotherObject.field is type Int.', - locations: [{ line: 7, column: 31 }, { line: 11, column: 28 }], + locations: [ + { line: 7, column: 31 }, + { line: 11, column: 28 }, + ], }, { message: 'Interface field argument AnotherInterface.field(input:) expects type String but AnotherObject.field(input:) is type Int.', - locations: [{ line: 7, column: 22 }, { line: 11, column: 22 }], + locations: [ + { line: 7, column: 22 }, + { line: 11, column: 22 }, + ], }, ]); }); @@ -1800,7 +1857,10 @@ describe('Objects must adhere to Interface they implement', () => { { message: 'Object field AnotherObject.field includes required argument requiredArg that is missing from the Interface field AnotherInterface.field.', - locations: [{ line: 13, column: 11 }, { line: 7, column: 9 }], + locations: [ + { line: 13, column: 11 }, + { line: 7, column: 9 }, + ], }, ]); }); @@ -1840,7 +1900,10 @@ describe('Objects must adhere to Interface they implement', () => { { message: 'Interface field AnotherInterface.field expects type [String] but AnotherObject.field is type String.', - locations: [{ line: 7, column: 16 }, { line: 11, column: 16 }], + locations: [ + { line: 7, column: 16 }, + { line: 11, column: 16 }, + ], }, ]); }); @@ -1863,7 +1926,10 @@ describe('Objects must adhere to Interface they implement', () => { { message: 'Interface field AnotherInterface.field expects type String but AnotherObject.field is type [String].', - locations: [{ line: 7, column: 16 }, { line: 11, column: 16 }], + locations: [ + { line: 7, column: 16 }, + { line: 11, column: 16 }, + ], }, ]); }); @@ -1903,7 +1969,10 @@ describe('Objects must adhere to Interface they implement', () => { { message: 'Interface field AnotherInterface.field expects type String! but AnotherObject.field is type String.', - locations: [{ line: 7, column: 16 }, { line: 11, column: 16 }], + locations: [ + { line: 7, column: 16 }, + { line: 11, column: 16 }, + ], }, ]); }); @@ -1930,7 +1999,10 @@ describe('Objects must adhere to Interface they implement', () => { { message: 'Type AnotherObject must implement SuperInterface because it is implemented by AnotherInterface.', - locations: [{ line: 10, column: 45 }, { line: 14, column: 37 }], + locations: [ + { line: 10, column: 45 }, + { line: 14, column: 37 }, + ], }, ]); }); @@ -2007,7 +2079,10 @@ describe('Interfaces must adhere to Interface they implement', () => { { message: 'Interface field ParentInterface.field expected but ChildInterface does not provide it.', - locations: [{ line: 7, column: 9 }, { line: 10, column: 7 }], + locations: [ + { line: 7, column: 9 }, + { line: 10, column: 7 }, + ], }, ]); }); @@ -2030,7 +2105,10 @@ describe('Interfaces must adhere to Interface they implement', () => { { message: 'Interface field ParentInterface.field expects type String but ChildInterface.field is type Int.', - locations: [{ line: 7, column: 31 }, { line: 11, column: 31 }], + locations: [ + { line: 7, column: 31 }, + { line: 11, column: 31 }, + ], }, ]); }); @@ -2056,7 +2134,10 @@ describe('Interfaces must adhere to Interface they implement', () => { { message: 'Interface field ParentInterface.field expects type A but ChildInterface.field is type B.', - locations: [{ line: 10, column: 16 }, { line: 14, column: 16 }], + locations: [ + { line: 10, column: 16 }, + { line: 14, column: 16 }, + ], }, ]); }); @@ -2119,7 +2200,10 @@ describe('Interfaces must adhere to Interface they implement', () => { { message: 'Interface field argument ParentInterface.field(input:) expected but ChildInterface.field does not provide it.', - locations: [{ line: 7, column: 15 }, { line: 11, column: 9 }], + locations: [ + { line: 7, column: 15 }, + { line: 11, column: 9 }, + ], }, ]); }); @@ -2142,7 +2226,10 @@ describe('Interfaces must adhere to Interface they implement', () => { { message: 'Interface field argument ParentInterface.field(input:) expects type String but ChildInterface.field(input:) is type Int.', - locations: [{ line: 7, column: 22 }, { line: 11, column: 22 }], + locations: [ + { line: 7, column: 22 }, + { line: 11, column: 22 }, + ], }, ]); }); @@ -2165,12 +2252,18 @@ describe('Interfaces must adhere to Interface they implement', () => { { message: 'Interface field ParentInterface.field expects type String but ChildInterface.field is type Int.', - locations: [{ line: 7, column: 31 }, { line: 11, column: 28 }], + locations: [ + { line: 7, column: 31 }, + { line: 11, column: 28 }, + ], }, { message: 'Interface field argument ParentInterface.field(input:) expects type String but ChildInterface.field(input:) is type Int.', - locations: [{ line: 7, column: 22 }, { line: 11, column: 22 }], + locations: [ + { line: 7, column: 22 }, + { line: 11, column: 22 }, + ], }, ]); }); @@ -2198,7 +2291,10 @@ describe('Interfaces must adhere to Interface they implement', () => { { message: 'Object field ChildInterface.field includes required argument requiredArg that is missing from the Interface field ParentInterface.field.', - locations: [{ line: 13, column: 11 }, { line: 7, column: 9 }], + locations: [ + { line: 13, column: 11 }, + { line: 7, column: 9 }, + ], }, ]); }); @@ -2238,7 +2334,10 @@ describe('Interfaces must adhere to Interface they implement', () => { { message: 'Interface field ParentInterface.field expects type [String] but ChildInterface.field is type String.', - locations: [{ line: 7, column: 16 }, { line: 11, column: 16 }], + locations: [ + { line: 7, column: 16 }, + { line: 11, column: 16 }, + ], }, ]); }); @@ -2261,7 +2360,10 @@ describe('Interfaces must adhere to Interface they implement', () => { { message: 'Interface field ParentInterface.field expects type String but ChildInterface.field is type [String].', - locations: [{ line: 7, column: 16 }, { line: 11, column: 16 }], + locations: [ + { line: 7, column: 16 }, + { line: 11, column: 16 }, + ], }, ]); }); @@ -2301,7 +2403,10 @@ describe('Interfaces must adhere to Interface they implement', () => { { message: 'Interface field ParentInterface.field expects type String! but ChildInterface.field is type String.', - locations: [{ line: 7, column: 16 }, { line: 11, column: 16 }], + locations: [ + { line: 7, column: 16 }, + { line: 11, column: 16 }, + ], }, ]); }); @@ -2328,7 +2433,10 @@ describe('Interfaces must adhere to Interface they implement', () => { { message: 'Type ChildInterface must implement SuperInterface because it is implemented by ParentInterface.', - locations: [{ line: 10, column: 44 }, { line: 14, column: 43 }], + locations: [ + { line: 10, column: 44 }, + { line: 14, column: 43 }, + ], }, ]); }); @@ -2372,12 +2480,18 @@ describe('Interfaces must adhere to Interface they implement', () => { { message: 'Type FooInterface cannot implement BarIntereface because it would create a circular reference.', - locations: [{ line: 10, column: 42 }, { line: 6, column: 41 }], + locations: [ + { line: 10, column: 42 }, + { line: 6, column: 41 }, + ], }, { message: 'Type BarIntereface cannot implement FooInterface because it would create a circular reference.', - locations: [{ line: 6, column: 41 }, { line: 10, column: 42 }], + locations: [ + { line: 6, column: 41 }, + { line: 10, column: 42 }, + ], }, ]); }); diff --git a/src/validation/__tests__/NoFragmentCycles-test.js b/src/validation/__tests__/NoFragmentCycles-test.js index 8f789709ff..8c882e15a1 100644 --- a/src/validation/__tests__/NoFragmentCycles-test.js +++ b/src/validation/__tests__/NoFragmentCycles-test.js @@ -103,7 +103,10 @@ describe('Validate: No circular fragment spreads', () => { `).to.deep.equal([ { message: 'Cannot spread fragment "fragA" within itself via "fragB".', - locations: [{ line: 2, column: 31 }, { line: 3, column: 31 }], + locations: [ + { line: 2, column: 31 }, + { line: 3, column: 31 }, + ], }, ]); }); @@ -115,7 +118,10 @@ describe('Validate: No circular fragment spreads', () => { `).to.deep.equal([ { message: 'Cannot spread fragment "fragB" within itself via "fragA".', - locations: [{ line: 2, column: 31 }, { line: 3, column: 31 }], + locations: [ + { line: 2, column: 31 }, + { line: 3, column: 31 }, + ], }, ]); }); @@ -135,7 +141,10 @@ describe('Validate: No circular fragment spreads', () => { `).to.deep.equal([ { message: 'Cannot spread fragment "fragA" within itself via "fragB".', - locations: [{ line: 4, column: 11 }, { line: 9, column: 11 }], + locations: [ + { line: 4, column: 11 }, + { line: 9, column: 11 }, + ], }, ]); }); @@ -184,11 +193,17 @@ describe('Validate: No circular fragment spreads', () => { `).to.deep.equal([ { message: 'Cannot spread fragment "fragA" within itself via "fragB".', - locations: [{ line: 2, column: 31 }, { line: 3, column: 31 }], + locations: [ + { line: 2, column: 31 }, + { line: 3, column: 31 }, + ], }, { message: 'Cannot spread fragment "fragA" within itself via "fragC".', - locations: [{ line: 2, column: 41 }, { line: 4, column: 31 }], + locations: [ + { line: 2, column: 41 }, + { line: 4, column: 31 }, + ], }, ]); }); @@ -201,11 +216,17 @@ describe('Validate: No circular fragment spreads', () => { `).to.deep.equal([ { message: 'Cannot spread fragment "fragA" within itself via "fragC".', - locations: [{ line: 2, column: 31 }, { line: 4, column: 31 }], + locations: [ + { line: 2, column: 31 }, + { line: 4, column: 31 }, + ], }, { message: 'Cannot spread fragment "fragC" within itself via "fragB".', - locations: [{ line: 4, column: 41 }, { line: 3, column: 31 }], + locations: [ + { line: 4, column: 41 }, + { line: 3, column: 31 }, + ], }, ]); }); @@ -231,7 +252,10 @@ describe('Validate: No circular fragment spreads', () => { }, { message: 'Cannot spread fragment "fragB" within itself via "fragC".', - locations: [{ line: 3, column: 41 }, { line: 4, column: 41 }], + locations: [ + { line: 3, column: 41 }, + { line: 4, column: 41 }, + ], }, ]); }); diff --git a/src/validation/__tests__/NoUndefinedVariables-test.js b/src/validation/__tests__/NoUndefinedVariables-test.js index 88a2e7995f..d16b0b3e5c 100644 --- a/src/validation/__tests__/NoUndefinedVariables-test.js +++ b/src/validation/__tests__/NoUndefinedVariables-test.js @@ -124,7 +124,10 @@ describe('Validate: No undefined variables', () => { `).to.deep.equal([ { message: 'Variable "$d" is not defined by operation "Foo".', - locations: [{ line: 3, column: 39 }, { line: 2, column: 7 }], + locations: [ + { line: 3, column: 39 }, + { line: 2, column: 7 }, + ], }, ]); }); @@ -137,7 +140,10 @@ describe('Validate: No undefined variables', () => { `).to.deep.equal([ { message: 'Variable "$a" is not defined.', - locations: [{ line: 3, column: 18 }, { line: 2, column: 7 }], + locations: [ + { line: 3, column: 18 }, + { line: 2, column: 7 }, + ], }, ]); }); @@ -150,11 +156,17 @@ describe('Validate: No undefined variables', () => { `).to.deep.equal([ { message: 'Variable "$a" is not defined by operation "Foo".', - locations: [{ line: 3, column: 18 }, { line: 2, column: 7 }], + locations: [ + { line: 3, column: 18 }, + { line: 2, column: 7 }, + ], }, { message: 'Variable "$c" is not defined by operation "Foo".', - locations: [{ line: 3, column: 32 }, { line: 2, column: 7 }], + locations: [ + { line: 3, column: 32 }, + { line: 2, column: 7 }, + ], }, ]); }); @@ -170,7 +182,10 @@ describe('Validate: No undefined variables', () => { `).to.deep.equal([ { message: 'Variable "$a" is not defined.', - locations: [{ line: 6, column: 18 }, { line: 2, column: 7 }], + locations: [ + { line: 6, column: 18 }, + { line: 2, column: 7 }, + ], }, ]); }); @@ -196,7 +211,10 @@ describe('Validate: No undefined variables', () => { `).to.deep.equal([ { message: 'Variable "$c" is not defined by operation "Foo".', - locations: [{ line: 16, column: 18 }, { line: 2, column: 7 }], + locations: [ + { line: 16, column: 18 }, + { line: 2, column: 7 }, + ], }, ]); }); @@ -222,11 +240,17 @@ describe('Validate: No undefined variables', () => { `).to.deep.equal([ { message: 'Variable "$a" is not defined by operation "Foo".', - locations: [{ line: 6, column: 18 }, { line: 2, column: 7 }], + locations: [ + { line: 6, column: 18 }, + { line: 2, column: 7 }, + ], }, { message: 'Variable "$c" is not defined by operation "Foo".', - locations: [{ line: 16, column: 18 }, { line: 2, column: 7 }], + locations: [ + { line: 16, column: 18 }, + { line: 2, column: 7 }, + ], }, ]); }); @@ -245,11 +269,17 @@ describe('Validate: No undefined variables', () => { `).to.deep.equal([ { message: 'Variable "$b" is not defined by operation "Foo".', - locations: [{ line: 9, column: 25 }, { line: 2, column: 7 }], + locations: [ + { line: 9, column: 25 }, + { line: 2, column: 7 }, + ], }, { message: 'Variable "$b" is not defined by operation "Bar".', - locations: [{ line: 9, column: 25 }, { line: 5, column: 7 }], + locations: [ + { line: 9, column: 25 }, + { line: 5, column: 7 }, + ], }, ]); }); @@ -268,11 +298,17 @@ describe('Validate: No undefined variables', () => { `).to.deep.equal([ { message: 'Variable "$a" is not defined by operation "Foo".', - locations: [{ line: 9, column: 18 }, { line: 2, column: 7 }], + locations: [ + { line: 9, column: 18 }, + { line: 2, column: 7 }, + ], }, { message: 'Variable "$b" is not defined by operation "Bar".', - locations: [{ line: 9, column: 25 }, { line: 5, column: 7 }], + locations: [ + { line: 9, column: 25 }, + { line: 5, column: 7 }, + ], }, ]); }); @@ -294,11 +330,17 @@ describe('Validate: No undefined variables', () => { `).to.deep.equal([ { message: 'Variable "$a" is not defined by operation "Foo".', - locations: [{ line: 9, column: 18 }, { line: 2, column: 7 }], + locations: [ + { line: 9, column: 18 }, + { line: 2, column: 7 }, + ], }, { message: 'Variable "$b" is not defined by operation "Bar".', - locations: [{ line: 12, column: 18 }, { line: 5, column: 7 }], + locations: [ + { line: 12, column: 18 }, + { line: 5, column: 7 }, + ], }, ]); }); @@ -322,27 +364,45 @@ describe('Validate: No undefined variables', () => { `).to.deep.equal([ { message: 'Variable "$a" is not defined by operation "Foo".', - locations: [{ line: 9, column: 19 }, { line: 2, column: 7 }], + locations: [ + { line: 9, column: 19 }, + { line: 2, column: 7 }, + ], }, { message: 'Variable "$a" is not defined by operation "Foo".', - locations: [{ line: 11, column: 19 }, { line: 2, column: 7 }], + locations: [ + { line: 11, column: 19 }, + { line: 2, column: 7 }, + ], }, { message: 'Variable "$c" is not defined by operation "Foo".', - locations: [{ line: 14, column: 19 }, { line: 2, column: 7 }], + locations: [ + { line: 14, column: 19 }, + { line: 2, column: 7 }, + ], }, { message: 'Variable "$b" is not defined by operation "Bar".', - locations: [{ line: 9, column: 26 }, { line: 5, column: 7 }], + locations: [ + { line: 9, column: 26 }, + { line: 5, column: 7 }, + ], }, { message: 'Variable "$b" is not defined by operation "Bar".', - locations: [{ line: 11, column: 26 }, { line: 5, column: 7 }], + locations: [ + { line: 11, column: 26 }, + { line: 5, column: 7 }, + ], }, { message: 'Variable "$c" is not defined by operation "Bar".', - locations: [{ line: 14, column: 19 }, { line: 5, column: 7 }], + locations: [ + { line: 14, column: 19 }, + { line: 5, column: 7 }, + ], }, ]); }); diff --git a/src/validation/__tests__/OverlappingFieldsCanBeMerged-test.js b/src/validation/__tests__/OverlappingFieldsCanBeMerged-test.js index 23ead587b8..0a743bf550 100644 --- a/src/validation/__tests__/OverlappingFieldsCanBeMerged-test.js +++ b/src/validation/__tests__/OverlappingFieldsCanBeMerged-test.js @@ -108,7 +108,10 @@ describe('Validate: Overlapping fields can be merged', () => { { message: 'Fields "fido" conflict because "name" and "nickname" are different fields. Use different aliases on the fields to fetch both if this was intentional.', - locations: [{ line: 3, column: 9 }, { line: 4, column: 9 }], + locations: [ + { line: 3, column: 9 }, + { line: 4, column: 9 }, + ], }, ]); }); @@ -138,7 +141,10 @@ describe('Validate: Overlapping fields can be merged', () => { { message: 'Fields "name" conflict because "nickname" and "name" are different fields. Use different aliases on the fields to fetch both if this was intentional.', - locations: [{ line: 3, column: 9 }, { line: 4, column: 9 }], + locations: [ + { line: 3, column: 9 }, + { line: 4, column: 9 }, + ], }, ]); }); @@ -153,7 +159,10 @@ describe('Validate: Overlapping fields can be merged', () => { { message: 'Fields "doesKnowCommand" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.', - locations: [{ line: 3, column: 9 }, { line: 4, column: 9 }], + locations: [ + { line: 3, column: 9 }, + { line: 4, column: 9 }, + ], }, ]); }); @@ -168,7 +177,10 @@ describe('Validate: Overlapping fields can be merged', () => { { message: 'Fields "doesKnowCommand" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.', - locations: [{ line: 3, column: 9 }, { line: 4, column: 9 }], + locations: [ + { line: 3, column: 9 }, + { line: 4, column: 9 }, + ], }, ]); }); @@ -183,7 +195,10 @@ describe('Validate: Overlapping fields can be merged', () => { { message: 'Fields "doesKnowCommand" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.', - locations: [{ line: 3, column: 9 }, { line: 4, column: 9 }], + locations: [ + { line: 3, column: 9 }, + { line: 4, column: 9 }, + ], }, ]); }); @@ -219,7 +234,10 @@ describe('Validate: Overlapping fields can be merged', () => { { message: 'Fields "x" conflict because "a" and "b" are different fields. Use different aliases on the fields to fetch both if this was intentional.', - locations: [{ line: 7, column: 9 }, { line: 10, column: 9 }], + locations: [ + { line: 7, column: 9 }, + { line: 10, column: 9 }, + ], }, ]); }); @@ -251,17 +269,26 @@ describe('Validate: Overlapping fields can be merged', () => { { message: 'Fields "x" conflict because "a" and "b" are different fields. Use different aliases on the fields to fetch both if this was intentional.', - locations: [{ line: 18, column: 9 }, { line: 21, column: 9 }], + locations: [ + { line: 18, column: 9 }, + { line: 21, column: 9 }, + ], }, { message: 'Fields "x" conflict because "c" and "a" are different fields. Use different aliases on the fields to fetch both if this was intentional.', - locations: [{ line: 14, column: 11 }, { line: 18, column: 9 }], + locations: [ + { line: 14, column: 11 }, + { line: 18, column: 9 }, + ], }, { message: 'Fields "x" conflict because "c" and "b" are different fields. Use different aliases on the fields to fetch both if this was intentional.', - locations: [{ line: 14, column: 11 }, { line: 21, column: 9 }], + locations: [ + { line: 14, column: 11 }, + { line: 21, column: 9 }, + ], }, ]); }); @@ -560,7 +587,10 @@ describe('Validate: Overlapping fields can be merged', () => { { message: 'Fields "scalar" conflict because they return conflicting types "Int" and "String!". Use different aliases on the fields to fetch both if this was intentional.', - locations: [{ line: 5, column: 17 }, { line: 8, column: 17 }], + locations: [ + { line: 5, column: 17 }, + { line: 8, column: 17 }, + ], }, ]); }); @@ -609,7 +639,10 @@ describe('Validate: Overlapping fields can be merged', () => { { message: 'Fields "scalar" conflict because they return conflicting types "Int" and "String". Use different aliases on the fields to fetch both if this was intentional.', - locations: [{ line: 5, column: 17 }, { line: 8, column: 17 }], + locations: [ + { line: 5, column: 17 }, + { line: 8, column: 17 }, + ], }, ]); }); @@ -694,7 +727,10 @@ describe('Validate: Overlapping fields can be merged', () => { { message: 'Fields "scalar" conflict because they return conflicting types "String!" and "String". Use different aliases on the fields to fetch both if this was intentional.', - locations: [{ line: 5, column: 17 }, { line: 8, column: 17 }], + locations: [ + { line: 5, column: 17 }, + { line: 8, column: 17 }, + ], }, ]); }); @@ -722,7 +758,10 @@ describe('Validate: Overlapping fields can be merged', () => { { message: 'Fields "box" conflict because they return conflicting types "[StringBox]" and "StringBox". Use different aliases on the fields to fetch both if this was intentional.', - locations: [{ line: 5, column: 17 }, { line: 10, column: 17 }], + locations: [ + { line: 5, column: 17 }, + { line: 10, column: 17 }, + ], }, ]); @@ -748,7 +787,10 @@ describe('Validate: Overlapping fields can be merged', () => { { message: 'Fields "box" conflict because they return conflicting types "StringBox" and "[StringBox]". Use different aliases on the fields to fetch both if this was intentional.', - locations: [{ line: 5, column: 17 }, { line: 10, column: 17 }], + locations: [ + { line: 5, column: 17 }, + { line: 10, column: 17 }, + ], }, ]); }); @@ -777,7 +819,10 @@ describe('Validate: Overlapping fields can be merged', () => { { message: 'Fields "val" conflict because "scalar" and "unrelatedField" are different fields. Use different aliases on the fields to fetch both if this was intentional.', - locations: [{ line: 6, column: 19 }, { line: 7, column: 19 }], + locations: [ + { line: 6, column: 19 }, + { line: 7, column: 19 }, + ], }, ]); }); @@ -977,7 +1022,10 @@ describe('Validate: Overlapping fields can be merged', () => { { message: 'Fields "fido" conflict because "name" and "nickname" are different fields. Use different aliases on the fields to fetch both if this was intentional.', - locations: [{ line: 4, column: 9 }, { line: 5, column: 9 }], + locations: [ + { line: 4, column: 9 }, + { line: 5, column: 9 }, + ], }, ]); }); diff --git a/src/validation/__tests__/PossibleTypeExtensions-test.js b/src/validation/__tests__/PossibleTypeExtensions-test.js index 2dd2406852..9493b9cfbb 100644 --- a/src/validation/__tests__/PossibleTypeExtensions-test.js +++ b/src/validation/__tests__/PossibleTypeExtensions-test.js @@ -136,27 +136,45 @@ describe('Validate: Possible type extensions', () => { `).to.deep.equal([ { message: 'Cannot extend non-object type "FooScalar".', - locations: [{ line: 2, column: 7 }, { line: 9, column: 7 }], + locations: [ + { line: 2, column: 7 }, + { line: 9, column: 7 }, + ], }, { message: 'Cannot extend non-interface type "FooObject".', - locations: [{ line: 3, column: 7 }, { line: 10, column: 7 }], + locations: [ + { line: 3, column: 7 }, + { line: 10, column: 7 }, + ], }, { message: 'Cannot extend non-union type "FooInterface".', - locations: [{ line: 4, column: 7 }, { line: 11, column: 7 }], + locations: [ + { line: 4, column: 7 }, + { line: 11, column: 7 }, + ], }, { message: 'Cannot extend non-enum type "FooUnion".', - locations: [{ line: 5, column: 7 }, { line: 12, column: 7 }], + locations: [ + { line: 5, column: 7 }, + { line: 12, column: 7 }, + ], }, { message: 'Cannot extend non-input object type "FooEnum".', - locations: [{ line: 6, column: 7 }, { line: 13, column: 7 }], + locations: [ + { line: 6, column: 7 }, + { line: 13, column: 7 }, + ], }, { message: 'Cannot extend non-scalar type "FooInputObject".', - locations: [{ line: 7, column: 7 }, { line: 14, column: 7 }], + locations: [ + { line: 7, column: 7 }, + { line: 14, column: 7 }, + ], }, ]); }); diff --git a/src/validation/__tests__/SingleFieldSubscriptions-test.js b/src/validation/__tests__/SingleFieldSubscriptions-test.js index b8d084f853..e70565b7db 100644 --- a/src/validation/__tests__/SingleFieldSubscriptions-test.js +++ b/src/validation/__tests__/SingleFieldSubscriptions-test.js @@ -64,7 +64,10 @@ describe('Validate: Subscriptions with single field', () => { { message: 'Subscription "ImportantEmails" must select only one top level field.', - locations: [{ line: 4, column: 9 }, { line: 5, column: 9 }], + locations: [ + { line: 4, column: 9 }, + { line: 5, column: 9 }, + ], }, ]); }); diff --git a/src/validation/__tests__/UniqueArgumentNames-test.js b/src/validation/__tests__/UniqueArgumentNames-test.js index a4396accbc..14cc877e0e 100644 --- a/src/validation/__tests__/UniqueArgumentNames-test.js +++ b/src/validation/__tests__/UniqueArgumentNames-test.js @@ -96,7 +96,10 @@ describe('Validate: Unique argument names', () => { `).to.deep.equal([ { message: 'There can be only one argument named "arg1".', - locations: [{ line: 3, column: 15 }, { line: 3, column: 30 }], + locations: [ + { line: 3, column: 15 }, + { line: 3, column: 30 }, + ], }, ]); }); @@ -109,11 +112,17 @@ describe('Validate: Unique argument names', () => { `).to.deep.equal([ { message: 'There can be only one argument named "arg1".', - locations: [{ line: 3, column: 15 }, { line: 3, column: 30 }], + locations: [ + { line: 3, column: 15 }, + { line: 3, column: 30 }, + ], }, { message: 'There can be only one argument named "arg1".', - locations: [{ line: 3, column: 15 }, { line: 3, column: 45 }], + locations: [ + { line: 3, column: 15 }, + { line: 3, column: 45 }, + ], }, ]); }); @@ -126,7 +135,10 @@ describe('Validate: Unique argument names', () => { `).to.deep.equal([ { message: 'There can be only one argument named "arg1".', - locations: [{ line: 3, column: 26 }, { line: 3, column: 41 }], + locations: [ + { line: 3, column: 26 }, + { line: 3, column: 41 }, + ], }, ]); }); @@ -139,11 +151,17 @@ describe('Validate: Unique argument names', () => { `).to.deep.equal([ { message: 'There can be only one argument named "arg1".', - locations: [{ line: 3, column: 26 }, { line: 3, column: 41 }], + locations: [ + { line: 3, column: 26 }, + { line: 3, column: 41 }, + ], }, { message: 'There can be only one argument named "arg1".', - locations: [{ line: 3, column: 26 }, { line: 3, column: 56 }], + locations: [ + { line: 3, column: 26 }, + { line: 3, column: 56 }, + ], }, ]); }); diff --git a/src/validation/__tests__/UniqueDirectiveNames-test.js b/src/validation/__tests__/UniqueDirectiveNames-test.js index 02207a5d5e..8583de3a5e 100644 --- a/src/validation/__tests__/UniqueDirectiveNames-test.js +++ b/src/validation/__tests__/UniqueDirectiveNames-test.js @@ -55,7 +55,10 @@ describe('Validate: Unique directive names', () => { `).to.deep.equal([ { message: 'There can be only one directive named "@foo".', - locations: [{ line: 2, column: 18 }, { line: 4, column: 18 }], + locations: [ + { line: 2, column: 18 }, + { line: 4, column: 18 }, + ], }, ]); }); diff --git a/src/validation/__tests__/UniqueDirectivesPerLocation-test.js b/src/validation/__tests__/UniqueDirectivesPerLocation-test.js index 3a02c6ee94..d3ecbe2d93 100644 --- a/src/validation/__tests__/UniqueDirectivesPerLocation-test.js +++ b/src/validation/__tests__/UniqueDirectivesPerLocation-test.js @@ -108,7 +108,10 @@ describe('Validate: Directives Are Unique Per Location', () => { { message: 'The directive "@directive" can only be used once at this location.', - locations: [{ line: 3, column: 15 }, { line: 3, column: 26 }], + locations: [ + { line: 3, column: 15 }, + { line: 3, column: 26 }, + ], }, ]); }); @@ -122,12 +125,18 @@ describe('Validate: Directives Are Unique Per Location', () => { { message: 'The directive "@directive" can only be used once at this location.', - locations: [{ line: 3, column: 15 }, { line: 3, column: 26 }], + locations: [ + { line: 3, column: 15 }, + { line: 3, column: 26 }, + ], }, { message: 'The directive "@directive" can only be used once at this location.', - locations: [{ line: 3, column: 15 }, { line: 3, column: 37 }], + locations: [ + { line: 3, column: 15 }, + { line: 3, column: 37 }, + ], }, ]); }); @@ -141,12 +150,18 @@ describe('Validate: Directives Are Unique Per Location', () => { { message: 'The directive "@directiveA" can only be used once at this location.', - locations: [{ line: 3, column: 15 }, { line: 3, column: 39 }], + locations: [ + { line: 3, column: 15 }, + { line: 3, column: 39 }, + ], }, { message: 'The directive "@directiveB" can only be used once at this location.', - locations: [{ line: 3, column: 27 }, { line: 3, column: 51 }], + locations: [ + { line: 3, column: 27 }, + { line: 3, column: 51 }, + ], }, ]); }); @@ -160,12 +175,18 @@ describe('Validate: Directives Are Unique Per Location', () => { { message: 'The directive "@directive" can only be used once at this location.', - locations: [{ line: 2, column: 29 }, { line: 2, column: 40 }], + locations: [ + { line: 2, column: 29 }, + { line: 2, column: 40 }, + ], }, { message: 'The directive "@directive" can only be used once at this location.', - locations: [{ line: 3, column: 15 }, { line: 3, column: 26 }], + locations: [ + { line: 3, column: 15 }, + { line: 3, column: 26 }, + ], }, ]); }); @@ -196,62 +217,98 @@ describe('Validate: Directives Are Unique Per Location', () => { { message: 'The directive "@nonRepeatable" can only be used once at this location.', - locations: [{ line: 5, column: 14 }, { line: 5, column: 29 }], + locations: [ + { line: 5, column: 14 }, + { line: 5, column: 29 }, + ], }, { message: 'The directive "@nonRepeatable" can only be used once at this location.', - locations: [{ line: 6, column: 21 }, { line: 6, column: 36 }], + locations: [ + { line: 6, column: 21 }, + { line: 6, column: 36 }, + ], }, { message: 'The directive "@nonRepeatable" can only be used once at this location.', - locations: [{ line: 8, column: 25 }, { line: 8, column: 40 }], + locations: [ + { line: 8, column: 25 }, + { line: 8, column: 40 }, + ], }, { message: 'The directive "@nonRepeatable" can only be used once at this location.', - locations: [{ line: 9, column: 32 }, { line: 9, column: 47 }], + locations: [ + { line: 9, column: 32 }, + { line: 9, column: 47 }, + ], }, { message: 'The directive "@nonRepeatable" can only be used once at this location.', - locations: [{ line: 11, column: 23 }, { line: 11, column: 38 }], + locations: [ + { line: 11, column: 23 }, + { line: 11, column: 38 }, + ], }, { message: 'The directive "@nonRepeatable" can only be used once at this location.', - locations: [{ line: 12, column: 30 }, { line: 12, column: 45 }], + locations: [ + { line: 12, column: 30 }, + { line: 12, column: 45 }, + ], }, { message: 'The directive "@nonRepeatable" can only be used once at this location.', - locations: [{ line: 14, column: 31 }, { line: 14, column: 46 }], + locations: [ + { line: 14, column: 31 }, + { line: 14, column: 46 }, + ], }, { message: 'The directive "@nonRepeatable" can only be used once at this location.', - locations: [{ line: 15, column: 38 }, { line: 15, column: 53 }], + locations: [ + { line: 15, column: 38 }, + { line: 15, column: 53 }, + ], }, { message: 'The directive "@nonRepeatable" can only be used once at this location.', - locations: [{ line: 17, column: 23 }, { line: 17, column: 38 }], + locations: [ + { line: 17, column: 23 }, + { line: 17, column: 38 }, + ], }, { message: 'The directive "@nonRepeatable" can only be used once at this location.', - locations: [{ line: 18, column: 30 }, { line: 18, column: 45 }], + locations: [ + { line: 18, column: 30 }, + { line: 18, column: 45 }, + ], }, { message: 'The directive "@nonRepeatable" can only be used once at this location.', - locations: [{ line: 20, column: 23 }, { line: 20, column: 38 }], + locations: [ + { line: 20, column: 23 }, + { line: 20, column: 38 }, + ], }, { message: 'The directive "@nonRepeatable" can only be used once at this location.', - locations: [{ line: 21, column: 30 }, { line: 21, column: 45 }], + locations: [ + { line: 21, column: 30 }, + { line: 21, column: 45 }, + ], }, ]); }); diff --git a/src/validation/__tests__/UniqueEnumValueNames-test.js b/src/validation/__tests__/UniqueEnumValueNames-test.js index 98ff97a3f4..0a1429fe76 100644 --- a/src/validation/__tests__/UniqueEnumValueNames-test.js +++ b/src/validation/__tests__/UniqueEnumValueNames-test.js @@ -50,7 +50,10 @@ describe('Validate: Unique enum value names', () => { `).to.deep.equal([ { message: 'Enum value "SomeEnum.FOO" can only be defined once.', - locations: [{ line: 3, column: 9 }, { line: 5, column: 9 }], + locations: [ + { line: 3, column: 9 }, + { line: 5, column: 9 }, + ], }, ]); }); @@ -80,7 +83,10 @@ describe('Validate: Unique enum value names', () => { `).to.deep.equal([ { message: 'Enum value "SomeEnum.FOO" can only be defined once.', - locations: [{ line: 3, column: 9 }, { line: 6, column: 9 }], + locations: [ + { line: 3, column: 9 }, + { line: 6, column: 9 }, + ], }, ]); }); @@ -96,7 +102,10 @@ describe('Validate: Unique enum value names', () => { `).to.deep.equal([ { message: 'Enum value "SomeEnum.FOO" can only be defined once.', - locations: [{ line: 4, column: 9 }, { line: 6, column: 9 }], + locations: [ + { line: 4, column: 9 }, + { line: 6, column: 9 }, + ], }, ]); }); @@ -113,7 +122,10 @@ describe('Validate: Unique enum value names', () => { `).to.deep.equal([ { message: 'Enum value "SomeEnum.FOO" can only be defined once.', - locations: [{ line: 4, column: 9 }, { line: 7, column: 9 }], + locations: [ + { line: 4, column: 9 }, + { line: 7, column: 9 }, + ], }, ]); }); @@ -172,7 +184,10 @@ describe('Validate: Unique enum value names', () => { expectSDLErrors(sdl, schema).to.deep.equal([ { message: 'Enum value "SomeEnum.FOO" can only be defined once.', - locations: [{ line: 3, column: 9 }, { line: 6, column: 9 }], + locations: [ + { line: 3, column: 9 }, + { line: 6, column: 9 }, + ], }, ]); }); diff --git a/src/validation/__tests__/UniqueFieldDefinitionNames-test.js b/src/validation/__tests__/UniqueFieldDefinitionNames-test.js index c3ff9a73cc..69cd1594f7 100644 --- a/src/validation/__tests__/UniqueFieldDefinitionNames-test.js +++ b/src/validation/__tests__/UniqueFieldDefinitionNames-test.js @@ -82,15 +82,24 @@ describe('Validate: Unique field definition names', () => { `).to.deep.equal([ { message: 'Field "SomeObject.foo" can only be defined once.', - locations: [{ line: 3, column: 9 }, { line: 5, column: 9 }], + locations: [ + { line: 3, column: 9 }, + { line: 5, column: 9 }, + ], }, { message: 'Field "SomeInterface.foo" can only be defined once.', - locations: [{ line: 9, column: 9 }, { line: 11, column: 9 }], + locations: [ + { line: 9, column: 9 }, + { line: 11, column: 9 }, + ], }, { message: 'Field "SomeInputObject.foo" can only be defined once.', - locations: [{ line: 15, column: 9 }, { line: 17, column: 9 }], + locations: [ + { line: 15, column: 9 }, + { line: 17, column: 9 }, + ], }, ]); }); @@ -154,15 +163,24 @@ describe('Validate: Unique field definition names', () => { `).to.deep.equal([ { message: 'Field "SomeObject.foo" can only be defined once.', - locations: [{ line: 3, column: 9 }, { line: 6, column: 9 }], + locations: [ + { line: 3, column: 9 }, + { line: 6, column: 9 }, + ], }, { message: 'Field "SomeInterface.foo" can only be defined once.', - locations: [{ line: 10, column: 9 }, { line: 13, column: 9 }], + locations: [ + { line: 10, column: 9 }, + { line: 13, column: 9 }, + ], }, { message: 'Field "SomeInputObject.foo" can only be defined once.', - locations: [{ line: 17, column: 9 }, { line: 20, column: 9 }], + locations: [ + { line: 17, column: 9 }, + { line: 20, column: 9 }, + ], }, ]); }); @@ -192,15 +210,24 @@ describe('Validate: Unique field definition names', () => { `).to.deep.equal([ { message: 'Field "SomeObject.foo" can only be defined once.', - locations: [{ line: 4, column: 9 }, { line: 6, column: 9 }], + locations: [ + { line: 4, column: 9 }, + { line: 6, column: 9 }, + ], }, { message: 'Field "SomeInterface.foo" can only be defined once.', - locations: [{ line: 11, column: 9 }, { line: 13, column: 9 }], + locations: [ + { line: 11, column: 9 }, + { line: 13, column: 9 }, + ], }, { message: 'Field "SomeInputObject.foo" can only be defined once.', - locations: [{ line: 18, column: 9 }, { line: 20, column: 9 }], + locations: [ + { line: 18, column: 9 }, + { line: 20, column: 9 }, + ], }, ]); }); @@ -233,15 +260,24 @@ describe('Validate: Unique field definition names', () => { `).to.deep.equal([ { message: 'Field "SomeObject.foo" can only be defined once.', - locations: [{ line: 4, column: 9 }, { line: 7, column: 9 }], + locations: [ + { line: 4, column: 9 }, + { line: 7, column: 9 }, + ], }, { message: 'Field "SomeInterface.foo" can only be defined once.', - locations: [{ line: 12, column: 9 }, { line: 15, column: 9 }], + locations: [ + { line: 12, column: 9 }, + { line: 15, column: 9 }, + ], }, { message: 'Field "SomeInputObject.foo" can only be defined once.', - locations: [{ line: 20, column: 9 }, { line: 23, column: 9 }], + locations: [ + { line: 20, column: 9 }, + { line: 23, column: 9 }, + ], }, ]); }); @@ -371,15 +407,24 @@ describe('Validate: Unique field definition names', () => { expectSDLErrors(sdl, schema).to.deep.equal([ { message: 'Field "SomeObject.foo" can only be defined once.', - locations: [{ line: 3, column: 9 }, { line: 6, column: 9 }], + locations: [ + { line: 3, column: 9 }, + { line: 6, column: 9 }, + ], }, { message: 'Field "SomeInterface.foo" can only be defined once.', - locations: [{ line: 10, column: 9 }, { line: 13, column: 9 }], + locations: [ + { line: 10, column: 9 }, + { line: 13, column: 9 }, + ], }, { message: 'Field "SomeInputObject.foo" can only be defined once.', - locations: [{ line: 17, column: 9 }, { line: 20, column: 9 }], + locations: [ + { line: 17, column: 9 }, + { line: 20, column: 9 }, + ], }, ]); }); diff --git a/src/validation/__tests__/UniqueFragmentNames-test.js b/src/validation/__tests__/UniqueFragmentNames-test.js index af5298059a..91fbea96fd 100644 --- a/src/validation/__tests__/UniqueFragmentNames-test.js +++ b/src/validation/__tests__/UniqueFragmentNames-test.js @@ -92,7 +92,10 @@ describe('Validate: Unique fragment names', () => { `).to.deep.equal([ { message: 'There can be only one fragment named "fragA".', - locations: [{ line: 5, column: 16 }, { line: 8, column: 16 }], + locations: [ + { line: 5, column: 16 }, + { line: 8, column: 16 }, + ], }, ]); }); @@ -108,7 +111,10 @@ describe('Validate: Unique fragment names', () => { `).to.deep.equal([ { message: 'There can be only one fragment named "fragA".', - locations: [{ line: 2, column: 16 }, { line: 5, column: 16 }], + locations: [ + { line: 2, column: 16 }, + { line: 5, column: 16 }, + ], }, ]); }); diff --git a/src/validation/__tests__/UniqueInputFieldNames-test.js b/src/validation/__tests__/UniqueInputFieldNames-test.js index 4286026c5c..c2c37ffb3f 100644 --- a/src/validation/__tests__/UniqueInputFieldNames-test.js +++ b/src/validation/__tests__/UniqueInputFieldNames-test.js @@ -63,7 +63,10 @@ describe('Validate: Unique input field names', () => { `).to.deep.equal([ { message: 'There can be only one input field named "f1".', - locations: [{ line: 3, column: 22 }, { line: 3, column: 35 }], + locations: [ + { line: 3, column: 22 }, + { line: 3, column: 35 }, + ], }, ]); }); @@ -76,11 +79,17 @@ describe('Validate: Unique input field names', () => { `).to.deep.equal([ { message: 'There can be only one input field named "f1".', - locations: [{ line: 3, column: 22 }, { line: 3, column: 35 }], + locations: [ + { line: 3, column: 22 }, + { line: 3, column: 35 }, + ], }, { message: 'There can be only one input field named "f1".', - locations: [{ line: 3, column: 22 }, { line: 3, column: 48 }], + locations: [ + { line: 3, column: 22 }, + { line: 3, column: 48 }, + ], }, ]); }); @@ -93,7 +102,10 @@ describe('Validate: Unique input field names', () => { `).to.deep.equal([ { message: 'There can be only one input field named "f2".', - locations: [{ line: 3, column: 27 }, { line: 3, column: 40 }], + locations: [ + { line: 3, column: 27 }, + { line: 3, column: 40 }, + ], }, ]); }); diff --git a/src/validation/__tests__/UniqueOperationNames-test.js b/src/validation/__tests__/UniqueOperationNames-test.js index ed5331802c..533c144728 100644 --- a/src/validation/__tests__/UniqueOperationNames-test.js +++ b/src/validation/__tests__/UniqueOperationNames-test.js @@ -89,7 +89,10 @@ describe('Validate: Unique operation names', () => { `).to.deep.equal([ { message: 'There can be only one operation named "Foo".', - locations: [{ line: 2, column: 13 }, { line: 5, column: 13 }], + locations: [ + { line: 2, column: 13 }, + { line: 5, column: 13 }, + ], }, ]); }); @@ -105,7 +108,10 @@ describe('Validate: Unique operation names', () => { `).to.deep.equal([ { message: 'There can be only one operation named "Foo".', - locations: [{ line: 2, column: 13 }, { line: 5, column: 16 }], + locations: [ + { line: 2, column: 13 }, + { line: 5, column: 16 }, + ], }, ]); }); @@ -121,7 +127,10 @@ describe('Validate: Unique operation names', () => { `).to.deep.equal([ { message: 'There can be only one operation named "Foo".', - locations: [{ line: 2, column: 13 }, { line: 5, column: 20 }], + locations: [ + { line: 2, column: 13 }, + { line: 5, column: 20 }, + ], }, ]); }); diff --git a/src/validation/__tests__/UniqueOperationTypes-test.js b/src/validation/__tests__/UniqueOperationTypes-test.js index ea8cd95590..5819d56357 100644 --- a/src/validation/__tests__/UniqueOperationTypes-test.js +++ b/src/validation/__tests__/UniqueOperationTypes-test.js @@ -85,15 +85,24 @@ describe('Validate: Unique operation types', () => { `).to.deep.equal([ { message: 'There can be only one query type in schema.', - locations: [{ line: 5, column: 9 }, { line: 9, column: 9 }], + locations: [ + { line: 5, column: 9 }, + { line: 9, column: 9 }, + ], }, { message: 'There can be only one mutation type in schema.', - locations: [{ line: 6, column: 9 }, { line: 10, column: 9 }], + locations: [ + { line: 6, column: 9 }, + { line: 10, column: 9 }, + ], }, { message: 'There can be only one subscription type in schema.', - locations: [{ line: 7, column: 9 }, { line: 11, column: 9 }], + locations: [ + { line: 7, column: 9 }, + { line: 11, column: 9 }, + ], }, ]); }); @@ -116,15 +125,24 @@ describe('Validate: Unique operation types', () => { `).to.deep.equal([ { message: 'There can be only one query type in schema.', - locations: [{ line: 5, column: 9 }, { line: 11, column: 9 }], + locations: [ + { line: 5, column: 9 }, + { line: 11, column: 9 }, + ], }, { message: 'There can be only one mutation type in schema.', - locations: [{ line: 6, column: 9 }, { line: 12, column: 9 }], + locations: [ + { line: 6, column: 9 }, + { line: 12, column: 9 }, + ], }, { message: 'There can be only one subscription type in schema.', - locations: [{ line: 7, column: 9 }, { line: 13, column: 9 }], + locations: [ + { line: 7, column: 9 }, + { line: 13, column: 9 }, + ], }, ]); }); @@ -153,27 +171,45 @@ describe('Validate: Unique operation types', () => { `).to.deep.equal([ { message: 'There can be only one query type in schema.', - locations: [{ line: 5, column: 9 }, { line: 11, column: 9 }], + locations: [ + { line: 5, column: 9 }, + { line: 11, column: 9 }, + ], }, { message: 'There can be only one mutation type in schema.', - locations: [{ line: 6, column: 9 }, { line: 12, column: 9 }], + locations: [ + { line: 6, column: 9 }, + { line: 12, column: 9 }, + ], }, { message: 'There can be only one subscription type in schema.', - locations: [{ line: 7, column: 9 }, { line: 13, column: 9 }], + locations: [ + { line: 7, column: 9 }, + { line: 13, column: 9 }, + ], }, { message: 'There can be only one query type in schema.', - locations: [{ line: 5, column: 9 }, { line: 17, column: 9 }], + locations: [ + { line: 5, column: 9 }, + { line: 17, column: 9 }, + ], }, { message: 'There can be only one mutation type in schema.', - locations: [{ line: 6, column: 9 }, { line: 18, column: 9 }], + locations: [ + { line: 6, column: 9 }, + { line: 18, column: 9 }, + ], }, { message: 'There can be only one subscription type in schema.', - locations: [{ line: 7, column: 9 }, { line: 19, column: 9 }], + locations: [ + { line: 7, column: 9 }, + { line: 19, column: 9 }, + ], }, ]); }); @@ -199,15 +235,24 @@ describe('Validate: Unique operation types', () => { `).to.deep.equal([ { message: 'There can be only one query type in schema.', - locations: [{ line: 5, column: 9 }, { line: 14, column: 9 }], + locations: [ + { line: 5, column: 9 }, + { line: 14, column: 9 }, + ], }, { message: 'There can be only one mutation type in schema.', - locations: [{ line: 9, column: 9 }, { line: 15, column: 9 }], + locations: [ + { line: 9, column: 9 }, + { line: 15, column: 9 }, + ], }, { message: 'There can be only one subscription type in schema.', - locations: [{ line: 10, column: 9 }, { line: 16, column: 9 }], + locations: [ + { line: 10, column: 9 }, + { line: 16, column: 9 }, + ], }, ]); }); diff --git a/src/validation/__tests__/UniqueTypeNames-test.js b/src/validation/__tests__/UniqueTypeNames-test.js index 2acc9cf678..9f610e6ade 100644 --- a/src/validation/__tests__/UniqueTypeNames-test.js +++ b/src/validation/__tests__/UniqueTypeNames-test.js @@ -60,27 +60,45 @@ describe('Validate: Unique type names', () => { `).to.deep.equal([ { message: 'There can be only one type named "Foo".', - locations: [{ line: 2, column: 12 }, { line: 4, column: 14 }], + locations: [ + { line: 2, column: 12 }, + { line: 4, column: 14 }, + ], }, { message: 'There can be only one type named "Foo".', - locations: [{ line: 2, column: 12 }, { line: 5, column: 12 }], + locations: [ + { line: 2, column: 12 }, + { line: 5, column: 12 }, + ], }, { message: 'There can be only one type named "Foo".', - locations: [{ line: 2, column: 12 }, { line: 6, column: 17 }], + locations: [ + { line: 2, column: 12 }, + { line: 6, column: 17 }, + ], }, { message: 'There can be only one type named "Foo".', - locations: [{ line: 2, column: 12 }, { line: 7, column: 13 }], + locations: [ + { line: 2, column: 12 }, + { line: 7, column: 13 }, + ], }, { message: 'There can be only one type named "Foo".', - locations: [{ line: 2, column: 12 }, { line: 8, column: 12 }], + locations: [ + { line: 2, column: 12 }, + { line: 8, column: 12 }, + ], }, { message: 'There can be only one type named "Foo".', - locations: [{ line: 2, column: 12 }, { line: 9, column: 13 }], + locations: [ + { line: 2, column: 12 }, + { line: 9, column: 13 }, + ], }, ]); }); diff --git a/src/validation/__tests__/UniqueVariableNames-test.js b/src/validation/__tests__/UniqueVariableNames-test.js index 6ce25ac700..902ef382cc 100644 --- a/src/validation/__tests__/UniqueVariableNames-test.js +++ b/src/validation/__tests__/UniqueVariableNames-test.js @@ -30,19 +30,31 @@ describe('Validate: Unique variable names', () => { `).to.deep.equal([ { message: 'There can be only one variable named "$x".', - locations: [{ line: 2, column: 16 }, { line: 2, column: 25 }], + locations: [ + { line: 2, column: 16 }, + { line: 2, column: 25 }, + ], }, { message: 'There can be only one variable named "$x".', - locations: [{ line: 2, column: 16 }, { line: 2, column: 34 }], + locations: [ + { line: 2, column: 16 }, + { line: 2, column: 34 }, + ], }, { message: 'There can be only one variable named "$x".', - locations: [{ line: 3, column: 16 }, { line: 3, column: 28 }], + locations: [ + { line: 3, column: 16 }, + { line: 3, column: 28 }, + ], }, { message: 'There can be only one variable named "$x".', - locations: [{ line: 4, column: 16 }, { line: 4, column: 25 }], + locations: [ + { line: 4, column: 16 }, + { line: 4, column: 25 }, + ], }, ]); }); diff --git a/src/validation/__tests__/VariablesInAllowedPosition-test.js b/src/validation/__tests__/VariablesInAllowedPosition-test.js index ab58bb6f08..31c5c79235 100644 --- a/src/validation/__tests__/VariablesInAllowedPosition-test.js +++ b/src/validation/__tests__/VariablesInAllowedPosition-test.js @@ -164,7 +164,10 @@ describe('Validate: Variables are in allowed positions', () => { { message: 'Variable "$intArg" of type "Int" used in position expecting type "Int!".', - locations: [{ line: 2, column: 19 }, { line: 4, column: 45 }], + locations: [ + { line: 2, column: 19 }, + { line: 4, column: 45 }, + ], }, ]); }); @@ -184,7 +187,10 @@ describe('Validate: Variables are in allowed positions', () => { { message: 'Variable "$intArg" of type "Int" used in position expecting type "Int!".', - locations: [{ line: 6, column: 19 }, { line: 3, column: 43 }], + locations: [ + { line: 6, column: 19 }, + { line: 3, column: 43 }, + ], }, ]); }); @@ -208,7 +214,10 @@ describe('Validate: Variables are in allowed positions', () => { { message: 'Variable "$intArg" of type "Int" used in position expecting type "Int!".', - locations: [{ line: 10, column: 19 }, { line: 7, column: 43 }], + locations: [ + { line: 10, column: 19 }, + { line: 7, column: 43 }, + ], }, ]); }); @@ -224,7 +233,10 @@ describe('Validate: Variables are in allowed positions', () => { { message: 'Variable "$stringVar" of type "String" used in position expecting type "Boolean".', - locations: [{ line: 2, column: 19 }, { line: 4, column: 39 }], + locations: [ + { line: 2, column: 19 }, + { line: 4, column: 39 }, + ], }, ]); }); @@ -240,7 +252,10 @@ describe('Validate: Variables are in allowed positions', () => { { message: 'Variable "$stringVar" of type "String" used in position expecting type "[String]".', - locations: [{ line: 2, column: 19 }, { line: 4, column: 45 }], + locations: [ + { line: 2, column: 19 }, + { line: 4, column: 45 }, + ], }, ]); }); @@ -254,7 +269,10 @@ describe('Validate: Variables are in allowed positions', () => { { message: 'Variable "$boolVar" of type "Boolean" used in position expecting type "Boolean!".', - locations: [{ line: 2, column: 19 }, { line: 3, column: 26 }], + locations: [ + { line: 2, column: 19 }, + { line: 3, column: 26 }, + ], }, ]); }); @@ -268,7 +286,10 @@ describe('Validate: Variables are in allowed positions', () => { { message: 'Variable "$stringVar" of type "String" used in position expecting type "Boolean!".', - locations: [{ line: 2, column: 19 }, { line: 3, column: 26 }], + locations: [ + { line: 2, column: 19 }, + { line: 3, column: 26 }, + ], }, ]); }); @@ -285,7 +306,10 @@ describe('Validate: Variables are in allowed positions', () => { { message: 'Variable "$stringListVar" of type "[String]" used in position expecting type "[String!]".', - locations: [{ line: 2, column: 19 }, { line: 5, column: 59 }], + locations: [ + { line: 2, column: 19 }, + { line: 5, column: 59 }, + ], }, ]); }); @@ -302,7 +326,10 @@ describe('Validate: Variables are in allowed positions', () => { { message: 'Variable "$intVar" of type "Int" used in position expecting type "Int!".', - locations: [{ line: 2, column: 21 }, { line: 4, column: 47 }], + locations: [ + { line: 2, column: 21 }, + { line: 4, column: 47 }, + ], }, ]); }); diff --git a/src/validation/index.d.ts b/src/validation/index.d.ts index 3c6d260df6..c4e38f5940 100644 --- a/src/validation/index.d.ts +++ b/src/validation/index.d.ts @@ -5,122 +5,76 @@ export { ValidationContext, ValidationRule } from './ValidationContext'; export { specifiedRules } from './specifiedRules'; // Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" -export { - FieldsOnCorrectType as FieldsOnCorrectTypeRule, -} from './rules/FieldsOnCorrectType'; +export { FieldsOnCorrectType as FieldsOnCorrectTypeRule } from './rules/FieldsOnCorrectType'; // Spec Section: "Fragments on Composite Types" -export { - FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule, -} from './rules/FragmentsOnCompositeTypes'; +export { FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule } from './rules/FragmentsOnCompositeTypes'; // Spec Section: "Argument Names" -export { - KnownArgumentNames as KnownArgumentNamesRule, -} from './rules/KnownArgumentNames'; +export { KnownArgumentNames as KnownArgumentNamesRule } from './rules/KnownArgumentNames'; // Spec Section: "Directives Are Defined" -export { - KnownDirectives as KnownDirectivesRule, -} from './rules/KnownDirectives'; +export { KnownDirectives as KnownDirectivesRule } from './rules/KnownDirectives'; // Spec Section: "Fragment spread target defined" -export { - KnownFragmentNames as KnownFragmentNamesRule, -} from './rules/KnownFragmentNames'; +export { KnownFragmentNames as KnownFragmentNamesRule } from './rules/KnownFragmentNames'; // Spec Section: "Fragment Spread Type Existence" export { KnownTypeNames as KnownTypeNamesRule } from './rules/KnownTypeNames'; // Spec Section: "Lone Anonymous Operation" -export { - LoneAnonymousOperation as LoneAnonymousOperationRule, -} from './rules/LoneAnonymousOperation'; +export { LoneAnonymousOperation as LoneAnonymousOperationRule } from './rules/LoneAnonymousOperation'; // Spec Section: "Fragments must not form cycles" -export { - NoFragmentCycles as NoFragmentCyclesRule, -} from './rules/NoFragmentCycles'; +export { NoFragmentCycles as NoFragmentCyclesRule } from './rules/NoFragmentCycles'; // Spec Section: "All Variable Used Defined" -export { - NoUndefinedVariables as NoUndefinedVariablesRule, -} from './rules/NoUndefinedVariables'; +export { NoUndefinedVariables as NoUndefinedVariablesRule } from './rules/NoUndefinedVariables'; // Spec Section: "Fragments must be used" -export { - NoUnusedFragments as NoUnusedFragmentsRule, -} from './rules/NoUnusedFragments'; +export { NoUnusedFragments as NoUnusedFragmentsRule } from './rules/NoUnusedFragments'; // Spec Section: "All Variables Used" -export { - NoUnusedVariables as NoUnusedVariablesRule, -} from './rules/NoUnusedVariables'; +export { NoUnusedVariables as NoUnusedVariablesRule } from './rules/NoUnusedVariables'; // Spec Section: "Field Selection Merging" -export { - OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule, -} from './rules/OverlappingFieldsCanBeMerged'; +export { OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule } from './rules/OverlappingFieldsCanBeMerged'; // Spec Section: "Fragment spread is possible" -export { - PossibleFragmentSpreads as PossibleFragmentSpreadsRule, -} from './rules/PossibleFragmentSpreads'; +export { PossibleFragmentSpreads as PossibleFragmentSpreadsRule } from './rules/PossibleFragmentSpreads'; // Spec Section: "Argument Optionality" -export { - ProvidedRequiredArguments as ProvidedRequiredArgumentsRule, -} from './rules/ProvidedRequiredArguments'; +export { ProvidedRequiredArguments as ProvidedRequiredArgumentsRule } from './rules/ProvidedRequiredArguments'; // Spec Section: "Leaf Field Selections" export { ScalarLeafs as ScalarLeafsRule } from './rules/ScalarLeafs'; // Spec Section: "Subscriptions with Single Root Field" -export { - SingleFieldSubscriptions as SingleFieldSubscriptionsRule, -} from './rules/SingleFieldSubscriptions'; +export { SingleFieldSubscriptions as SingleFieldSubscriptionsRule } from './rules/SingleFieldSubscriptions'; // Spec Section: "Argument Uniqueness" -export { - UniqueArgumentNames as UniqueArgumentNamesRule, -} from './rules/UniqueArgumentNames'; +export { UniqueArgumentNames as UniqueArgumentNamesRule } from './rules/UniqueArgumentNames'; // Spec Section: "Directives Are Unique Per Location" -export { - UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule, -} from './rules/UniqueDirectivesPerLocation'; +export { UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule } from './rules/UniqueDirectivesPerLocation'; // Spec Section: "Fragment Name Uniqueness" -export { - UniqueFragmentNames as UniqueFragmentNamesRule, -} from './rules/UniqueFragmentNames'; +export { UniqueFragmentNames as UniqueFragmentNamesRule } from './rules/UniqueFragmentNames'; // Spec Section: "Input Object Field Uniqueness" -export { - UniqueInputFieldNames as UniqueInputFieldNamesRule, -} from './rules/UniqueInputFieldNames'; +export { UniqueInputFieldNames as UniqueInputFieldNamesRule } from './rules/UniqueInputFieldNames'; // Spec Section: "Operation Name Uniqueness" -export { - UniqueOperationNames as UniqueOperationNamesRule, -} from './rules/UniqueOperationNames'; +export { UniqueOperationNames as UniqueOperationNamesRule } from './rules/UniqueOperationNames'; // Spec Section: "Variable Uniqueness" -export { - UniqueVariableNames as UniqueVariableNamesRule, -} from './rules/UniqueVariableNames'; +export { UniqueVariableNames as UniqueVariableNamesRule } from './rules/UniqueVariableNames'; // Spec Section: "Values Type Correctness" -export { - ValuesOfCorrectType as ValuesOfCorrectTypeRule, -} from './rules/ValuesOfCorrectType'; +export { ValuesOfCorrectType as ValuesOfCorrectTypeRule } from './rules/ValuesOfCorrectType'; // Spec Section: "Variables are Input Types" -export { - VariablesAreInputTypes as VariablesAreInputTypesRule, -} from './rules/VariablesAreInputTypes'; +export { VariablesAreInputTypes as VariablesAreInputTypesRule } from './rules/VariablesAreInputTypes'; // Spec Section: "All Variable Usages Are Allowed" -export { - VariablesInAllowedPosition as VariablesInAllowedPositionRule, -} from './rules/VariablesInAllowedPosition'; +export { VariablesInAllowedPosition as VariablesInAllowedPositionRule } from './rules/VariablesInAllowedPosition'; diff --git a/src/validation/index.js b/src/validation/index.js index 16fc9bf2fa..55dfb26742 100644 --- a/src/validation/index.js +++ b/src/validation/index.js @@ -9,122 +9,76 @@ export type { ValidationRule } from './ValidationContext'; export { specifiedRules } from './specifiedRules'; // Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" -export { - FieldsOnCorrectType as FieldsOnCorrectTypeRule, -} from './rules/FieldsOnCorrectType'; +export { FieldsOnCorrectType as FieldsOnCorrectTypeRule } from './rules/FieldsOnCorrectType'; // Spec Section: "Fragments on Composite Types" -export { - FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule, -} from './rules/FragmentsOnCompositeTypes'; +export { FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule } from './rules/FragmentsOnCompositeTypes'; // Spec Section: "Argument Names" -export { - KnownArgumentNames as KnownArgumentNamesRule, -} from './rules/KnownArgumentNames'; +export { KnownArgumentNames as KnownArgumentNamesRule } from './rules/KnownArgumentNames'; // Spec Section: "Directives Are Defined" -export { - KnownDirectives as KnownDirectivesRule, -} from './rules/KnownDirectives'; +export { KnownDirectives as KnownDirectivesRule } from './rules/KnownDirectives'; // Spec Section: "Fragment spread target defined" -export { - KnownFragmentNames as KnownFragmentNamesRule, -} from './rules/KnownFragmentNames'; +export { KnownFragmentNames as KnownFragmentNamesRule } from './rules/KnownFragmentNames'; // Spec Section: "Fragment Spread Type Existence" export { KnownTypeNames as KnownTypeNamesRule } from './rules/KnownTypeNames'; // Spec Section: "Lone Anonymous Operation" -export { - LoneAnonymousOperation as LoneAnonymousOperationRule, -} from './rules/LoneAnonymousOperation'; +export { LoneAnonymousOperation as LoneAnonymousOperationRule } from './rules/LoneAnonymousOperation'; // Spec Section: "Fragments must not form cycles" -export { - NoFragmentCycles as NoFragmentCyclesRule, -} from './rules/NoFragmentCycles'; +export { NoFragmentCycles as NoFragmentCyclesRule } from './rules/NoFragmentCycles'; // Spec Section: "All Variable Used Defined" -export { - NoUndefinedVariables as NoUndefinedVariablesRule, -} from './rules/NoUndefinedVariables'; +export { NoUndefinedVariables as NoUndefinedVariablesRule } from './rules/NoUndefinedVariables'; // Spec Section: "Fragments must be used" -export { - NoUnusedFragments as NoUnusedFragmentsRule, -} from './rules/NoUnusedFragments'; +export { NoUnusedFragments as NoUnusedFragmentsRule } from './rules/NoUnusedFragments'; // Spec Section: "All Variables Used" -export { - NoUnusedVariables as NoUnusedVariablesRule, -} from './rules/NoUnusedVariables'; +export { NoUnusedVariables as NoUnusedVariablesRule } from './rules/NoUnusedVariables'; // Spec Section: "Field Selection Merging" -export { - OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule, -} from './rules/OverlappingFieldsCanBeMerged'; +export { OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule } from './rules/OverlappingFieldsCanBeMerged'; // Spec Section: "Fragment spread is possible" -export { - PossibleFragmentSpreads as PossibleFragmentSpreadsRule, -} from './rules/PossibleFragmentSpreads'; +export { PossibleFragmentSpreads as PossibleFragmentSpreadsRule } from './rules/PossibleFragmentSpreads'; // Spec Section: "Argument Optionality" -export { - ProvidedRequiredArguments as ProvidedRequiredArgumentsRule, -} from './rules/ProvidedRequiredArguments'; +export { ProvidedRequiredArguments as ProvidedRequiredArgumentsRule } from './rules/ProvidedRequiredArguments'; // Spec Section: "Leaf Field Selections" export { ScalarLeafs as ScalarLeafsRule } from './rules/ScalarLeafs'; // Spec Section: "Subscriptions with Single Root Field" -export { - SingleFieldSubscriptions as SingleFieldSubscriptionsRule, -} from './rules/SingleFieldSubscriptions'; +export { SingleFieldSubscriptions as SingleFieldSubscriptionsRule } from './rules/SingleFieldSubscriptions'; // Spec Section: "Argument Uniqueness" -export { - UniqueArgumentNames as UniqueArgumentNamesRule, -} from './rules/UniqueArgumentNames'; +export { UniqueArgumentNames as UniqueArgumentNamesRule } from './rules/UniqueArgumentNames'; // Spec Section: "Directives Are Unique Per Location" -export { - UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule, -} from './rules/UniqueDirectivesPerLocation'; +export { UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule } from './rules/UniqueDirectivesPerLocation'; // Spec Section: "Fragment Name Uniqueness" -export { - UniqueFragmentNames as UniqueFragmentNamesRule, -} from './rules/UniqueFragmentNames'; +export { UniqueFragmentNames as UniqueFragmentNamesRule } from './rules/UniqueFragmentNames'; // Spec Section: "Input Object Field Uniqueness" -export { - UniqueInputFieldNames as UniqueInputFieldNamesRule, -} from './rules/UniqueInputFieldNames'; +export { UniqueInputFieldNames as UniqueInputFieldNamesRule } from './rules/UniqueInputFieldNames'; // Spec Section: "Operation Name Uniqueness" -export { - UniqueOperationNames as UniqueOperationNamesRule, -} from './rules/UniqueOperationNames'; +export { UniqueOperationNames as UniqueOperationNamesRule } from './rules/UniqueOperationNames'; // Spec Section: "Variable Uniqueness" -export { - UniqueVariableNames as UniqueVariableNamesRule, -} from './rules/UniqueVariableNames'; +export { UniqueVariableNames as UniqueVariableNamesRule } from './rules/UniqueVariableNames'; // Spec Section: "Values Type Correctness" -export { - ValuesOfCorrectType as ValuesOfCorrectTypeRule, -} from './rules/ValuesOfCorrectType'; +export { ValuesOfCorrectType as ValuesOfCorrectTypeRule } from './rules/ValuesOfCorrectType'; // Spec Section: "Variables are Input Types" -export { - VariablesAreInputTypes as VariablesAreInputTypesRule, -} from './rules/VariablesAreInputTypes'; +export { VariablesAreInputTypes as VariablesAreInputTypesRule } from './rules/VariablesAreInputTypes'; // Spec Section: "All Variable Usages Are Allowed" -export { - VariablesInAllowedPosition as VariablesInAllowedPositionRule, -} from './rules/VariablesInAllowedPosition'; +export { VariablesInAllowedPosition as VariablesInAllowedPositionRule } from './rules/VariablesInAllowedPosition'; diff --git a/yarn.lock b/yarn.lock index 54e2fe20e5..1ccc84410d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2457,10 +2457,10 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= -prettier@1.18.2: - version "1.18.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" - integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== +prettier@1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" + integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== private@^0.1.6: version "0.1.8"