Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/__tests__/starWarsIntrospection-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,8 @@ describe('Star Wars Introspection Tests', () => {
{
defaultValue: null,
description:
'If omitted, returns the hero of the whole ' +
'saga. If provided, returns the hero of ' +
'that particular episode.',
'If omitted, returns the hero of the whole saga. ' +
'If provided, returns the hero of that particular episode.',
name: 'episode',
type: {
kind: 'ENUM',
Expand Down
7 changes: 3 additions & 4 deletions src/__tests__/starWarsSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ const characterInterface = new GraphQLInterfaceType({
friends: {
type: GraphQLList(characterInterface),
description:
'The friends of the character, or an empty list if they ' +
'have none.',
'The friends of the character, or an empty list if they have none.',
},
appearsIn: {
type: GraphQLList(episodeEnum),
Expand Down Expand Up @@ -263,8 +262,8 @@ const queryType = new GraphQLObjectType({
args: {
episode: {
description:
'If omitted, returns the hero of the whole saga. If ' +
'provided, returns the hero of that particular episode.',
'If omitted, returns the hero of the whole saga. ' +
'If provided, returns the hero of that particular episode.',
type: episodeEnum,
},
},
Expand Down
14 changes: 8 additions & 6 deletions src/error/__tests__/printError-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ describe('printError', () => {
const sourceA = parse(
new Source(
dedent`
type Foo {
field: String
}`,
type Foo {
field: String
}
`,
'SourceA',
),
);
Expand All @@ -60,9 +61,10 @@ describe('printError', () => {
const sourceB = parse(
new Source(
dedent`
type Foo {
field: Int
}`,
type Foo {
field: Int
}
`,
'SourceB',
),
);
Expand Down
6 changes: 2 additions & 4 deletions src/execution/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,7 @@ export function buildExecutionContext(
} else if (hasMultipleAssumedOperations) {
errors.push(
new GraphQLError(
'Must provide operation name if query contains ' +
'multiple operations.',
'Must provide operation name if query contains multiple operations.',
),
);
}
Expand Down Expand Up @@ -1049,8 +1048,7 @@ function ensureValidRuntimeType(
`runtime for field ${info.parentType.name}.${info.fieldName} with ` +
`value ${inspect(result)}, received "${inspect(runtimeType)}". ` +
`Either the ${returnType.name} type should provide a "resolveType" ` +
'function or each possible type should provide an ' +
'"isTypeOf" function.',
'function or each possible type should provide an "isTypeOf" function.',
fieldNodes,
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/execution/values.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ export function getVariableValues(
if (coercionErrors) {
for (const error of coercionErrors) {
error.message =
`Variable "$${varName}" got invalid ` +
`value ${inspect(value)}; ${error.message}`;
`Variable "$${varName}" got invalid value ${inspect(value)}; ` +
error.message;
}
errors.push(...coercionErrors);
} else {
Expand Down
26 changes: 13 additions & 13 deletions src/jsutils/__tests__/dedent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ describe('dedent', () => {
type Query {
me: User
}

type User {
id: ID
name: String
}
`;
`;
expect(output).to.equal(
[
'type Query {',
Expand All @@ -42,7 +42,7 @@ describe('dedent', () => {
quux
quuux
quuuux
`;
`;
expect(output).to.equal(
['qux', ' quux', ' quuux', ' quuuux', ''].join('\n'),
);
Expand All @@ -53,7 +53,7 @@ describe('dedent', () => {
type Root {
field(arg: String = "wi\th de\fault"): String
}
`;
`;
expect(output).to.equal(
[
'type Root {',
Expand All @@ -69,7 +69,7 @@ describe('dedent', () => {
type Query {
me: User
}
`);
`);
expect(output).to.equal(['type Query {', ' me: User', '}', ''].join('\n'));
});

Expand All @@ -78,7 +78,7 @@ describe('dedent', () => {
\t\t type Query {
\t\t me: User
\t\t }
`;
`;
expect(output).to.equal(['type Query {', ' me: User', '}', ''].join('\n'));
});

Expand All @@ -98,7 +98,7 @@ describe('dedent', () => {
me: User
}

`;
`;
expect(output).to.equal(
['type Query {', ' me: User', '}', '', ''].join('\n'),
);
Expand All @@ -124,13 +124,13 @@ describe('dedent', () => {
const name = 'Luke Skywalker';
const age = 42;
const output = dedent`
{
"me": {
"name": "${name}"
"age": ${age}
}
{
"me": {
"name": "${name}"
"age": ${age}
}
`;
}
`;
expect(output).to.equal(
[
'{',
Expand Down
2 changes: 1 addition & 1 deletion src/jsutils/dedent.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function fixIndent(str: string): string {
* {
* test
* }
* `
* `;
* str === "{\n test\n}\n";
*/
export default function dedent(
Expand Down
9 changes: 3 additions & 6 deletions src/type/__tests__/introspection-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1293,8 +1293,7 @@ describe('Introspection', () => {
'A GraphQL Schema defines the capabilities of a ' +
'GraphQL server. It exposes all available types and ' +
'directives on the server, as well as the entry ' +
'points for query, mutation, ' +
'and subscription operations.',
'points for query, mutation, and subscription operations.',
fields: [
{
name: 'types',
Expand Down Expand Up @@ -1391,14 +1390,12 @@ describe('Introspection', () => {
},
{
description:
'Indicates this type is a list. ' +
'`ofType` is a valid field.',
'Indicates this type is a list. `ofType` is a valid field.',
name: 'LIST',
},
{
description:
'Indicates this type is a non-null. ' +
'`ofType` is a valid field.',
'Indicates this type is a non-null. `ofType` is a valid field.',
name: 'NON_NULL',
},
],
Expand Down
12 changes: 6 additions & 6 deletions src/utilities/__tests__/buildASTSchema-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ describe('Schema Builder', () => {
});

it('Maintains @skip & @include', () => {
const body = dedent`
const body = `
type Query {
str: String
}
Expand All @@ -159,7 +159,7 @@ describe('Schema Builder', () => {
});

it('Overriding directives excludes specified', () => {
const body = dedent`
const body = `
directive @skip on FIELD
directive @include on FIELD
directive @deprecated on FIELD_DEFINITION
Expand All @@ -180,7 +180,7 @@ describe('Schema Builder', () => {
});

it('Adding directives maintains @skip & @include', () => {
const body = dedent`
const body = `
directive @foo(arg: Int) on FIELD

type Query {
Expand Down Expand Up @@ -357,7 +357,7 @@ describe('Schema Builder', () => {
});

it('Can build recursive Union', () => {
const schema = buildSchema(dedent`
const schema = buildSchema(`
union Hello = Hello

type Query {
Expand All @@ -369,7 +369,7 @@ describe('Schema Builder', () => {
});

it('Specifying Union type using __typename', () => {
const schema = buildSchema(dedent`
const schema = buildSchema(`
type Query {
fruits: [Fruit]
}
Expand Down Expand Up @@ -426,7 +426,7 @@ describe('Schema Builder', () => {
});

it('Specifying Interface type using __typename', () => {
const schema = buildSchema(dedent`
const schema = buildSchema(`
type Query {
characters: [Character]
}
Expand Down
20 changes: 10 additions & 10 deletions src/utilities/__tests__/lexicographicSortSchema-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function sortSDL(sdl) {

describe('lexicographicSortSchema', () => {
it('sort fields', () => {
const sorted = sortSDL(dedent`
const sorted = sortSDL(`
input Bar {
barB: String
barA: String
Expand Down Expand Up @@ -69,7 +69,7 @@ describe('lexicographicSortSchema', () => {
});

it('sort implemented interfaces', () => {
const sorted = sortSDL(dedent`
const sorted = sortSDL(`
interface FooA {
dummy: String
}
Expand Down Expand Up @@ -107,7 +107,7 @@ describe('lexicographicSortSchema', () => {
});

it('sort types in union', () => {
const sorted = sortSDL(dedent`
const sorted = sortSDL(`
type FooA {
dummy: String
}
Expand Down Expand Up @@ -149,7 +149,7 @@ describe('lexicographicSortSchema', () => {
});

it('sort enum values', () => {
const sorted = sortSDL(dedent`
const sorted = sortSDL(`
enum Foo {
B
C
Expand All @@ -175,7 +175,7 @@ describe('lexicographicSortSchema', () => {
});

it('sort field arguments', () => {
const sorted = sortSDL(dedent`
const sorted = sortSDL(`
type Query {
dummy(argB: Int, argA: String, argC: Float): ID
}
Expand All @@ -189,7 +189,7 @@ describe('lexicographicSortSchema', () => {
});

it('sort types', () => {
const sorted = sortSDL(dedent`
const sorted = sortSDL(`
type Query {
dummy(arg1: FooF, arg2: FooA, arg3: FooG): FooD
}
Expand Down Expand Up @@ -251,7 +251,7 @@ describe('lexicographicSortSchema', () => {
});

it('sort directive arguments', () => {
const sorted = sortSDL(dedent`
const sorted = sortSDL(`
directive @test(argC: Float, argA: String, argB: Int) on FIELD

type Query {
Expand All @@ -269,7 +269,7 @@ describe('lexicographicSortSchema', () => {
});

it('sort directive locations', () => {
const sorted = sortSDL(dedent`
const sorted = sortSDL(`
directive @test(argC: Float, argA: String, argB: Int) on UNION | FIELD | ENUM

type Query {
Expand All @@ -287,7 +287,7 @@ describe('lexicographicSortSchema', () => {
});

it('sort directives', () => {
const sorted = sortSDL(dedent`
const sorted = sortSDL(`
directive @fooC on FIELD

directive @fooB on UNION
Expand All @@ -313,7 +313,7 @@ describe('lexicographicSortSchema', () => {
});

it('sort recursive types', () => {
const sorted = sortSDL(dedent`
const sorted = sortSDL(`
interface FooC {
fooB: FooB
fooA: FooA
Expand Down
8 changes: 4 additions & 4 deletions src/utilities/__tests__/schemaPrinter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ describe('Type System Printer', () => {
});
expect(output).to.equal(
dedent(String.raw`
type Query {
singleField(argOne: String = "tes\t de\fault"): String
}
`),
type Query {
singleField(argOne: String = "tes\t de\fault"): String
}
`),
);
});

Expand Down
5 changes: 2 additions & 3 deletions src/validation/rules/OverlappingFieldsCanBeMerged.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ export function fieldsConflictMessage(
reason: ConflictReasonMessage,
): string {
return (
`Fields "${responseName}" conflict because ${reasonMessage(reason)}` +
'. Use different aliases on the fields to fetch both if this was ' +
'intentional.'
`Fields "${responseName}" conflict because ${reasonMessage(reason)}. ` +
'Use different aliases on the fields to fetch both if this was intentional.'
);
}

Expand Down