Skip to content

Commit e4ba457

Browse files
More fixes to make spellchecker happy (#2296)
1 parent 8394bee commit e4ba457

File tree

11 files changed

+61
-62
lines changed

11 files changed

+61
-62
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ first ensure the query is syntactically and semantically valid before executing
8888
it, reporting errors otherwise.
8989

9090
```js
91-
var query = '{ boyhowdy }';
91+
var query = '{ BoyHowdy }';
9292

9393
graphql(schema, query).then(result => {
9494
// Prints
9595
// {
9696
// errors: [
97-
// { message: 'Cannot query field boyhowdy on RootQueryType',
97+
// { message: 'Cannot query field BoyHowdy on RootQueryType',
9898
// locations: [ { line: 1, column: 3 } ] }
9999
// ]
100100
// }

src/language/printLocation.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,20 @@ export function printSourceLocation(
3737

3838
// Special case for minified documents
3939
if (locationLine.length > 120) {
40-
const sublineIndex = Math.floor(columnNum / 80);
41-
const sublineColumnNum = columnNum % 80;
42-
const sublines = [];
40+
const subLineIndex = Math.floor(columnNum / 80);
41+
const subLineColumnNum = columnNum % 80;
42+
const subLines = [];
4343
for (let i = 0; i < locationLine.length; i += 80) {
44-
sublines.push(locationLine.slice(i, i + 80));
44+
subLines.push(locationLine.slice(i, i + 80));
4545
}
4646

4747
return (
4848
locationStr +
4949
printPrefixedLines([
50-
[`${lineNum}`, sublines[0]],
51-
...sublines.slice(1, sublineIndex + 1).map(subline => ['', subline]),
52-
[' ', whitespace(sublineColumnNum - 1) + '^'],
53-
['', sublines[sublineIndex + 1]],
50+
[`${lineNum}`, subLines[0]],
51+
...subLines.slice(1, subLineIndex + 1).map(subLine => ['', subLine]),
52+
[' ', whitespace(subLineColumnNum - 1) + '^'],
53+
['', subLines[subLineIndex + 1]],
5454
])
5555
);
5656
}

src/type/schema.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -328,47 +328,47 @@ export type GraphQLSchemaConfig = {|
328328
function collectImplementations(
329329
types: $ReadOnlyArray<GraphQLNamedType>,
330330
): ObjMap<InterfaceImplementations> {
331-
const implementations = Object.create(null);
331+
const implementationsMap = Object.create(null);
332332

333333
for (const type of types) {
334334
if (isInterfaceType(type)) {
335-
if (implementations[type.name] === undefined) {
336-
implementations[type.name] = { objects: [], interfaces: [] };
335+
if (implementationsMap[type.name] === undefined) {
336+
implementationsMap[type.name] = { objects: [], interfaces: [] };
337337
}
338338

339339
// Store implementations by interface.
340340
for (const iface of type.getInterfaces()) {
341341
if (isInterfaceType(iface)) {
342-
const impls = implementations[iface.name];
343-
if (impls === undefined) {
344-
implementations[iface.name] = {
342+
const implementations = implementationsMap[iface.name];
343+
if (implementations === undefined) {
344+
implementationsMap[iface.name] = {
345345
objects: [],
346346
interfaces: [type],
347347
};
348348
} else {
349-
impls.interfaces.push(type);
349+
implementations.interfaces.push(type);
350350
}
351351
}
352352
}
353353
} else if (isObjectType(type)) {
354354
// Store implementations by objects.
355355
for (const iface of type.getInterfaces()) {
356356
if (isInterfaceType(iface)) {
357-
const impls = implementations[iface.name];
358-
if (impls === undefined) {
359-
implementations[iface.name] = {
357+
const implementations = implementationsMap[iface.name];
358+
if (implementations === undefined) {
359+
implementationsMap[iface.name] = {
360360
objects: [type],
361361
interfaces: [],
362362
};
363363
} else {
364-
impls.objects.push(type);
364+
implementations.objects.push(type);
365365
}
366366
}
367367
}
368368
}
369369
}
370370

371-
return implementations;
371+
return implementationsMap;
372372
}
373373

374374
function typeMapReducer(map: TypeMap, type: ?GraphQLType): TypeMap {

src/utilities/__tests__/buildASTSchema-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -649,16 +649,16 @@ describe('Schema Builder', () => {
649649

650650
it('Unreferenced type implementing referenced interface', () => {
651651
const sdl = dedent`
652-
type Concrete implements Iface {
652+
type Concrete implements Interface {
653653
key: String
654654
}
655655
656-
interface Iface {
656+
interface Interface {
657657
key: String
658658
}
659659
660660
type Query {
661-
iface: Iface
661+
interface: Interface
662662
}
663663
`;
664664
expect(cycleSDL(sdl)).to.equal(sdl);
@@ -675,7 +675,7 @@ describe('Schema Builder', () => {
675675
}
676676
677677
type Query {
678-
iface: Parent
678+
interfaceField: Parent
679679
}
680680
`;
681681
expect(cycleSDL(sdl)).to.equal(sdl);

src/utilities/extendSchema.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -108,28 +108,28 @@ export function extendSchema(
108108

109109
// Collect the type definitions and extensions found in the document.
110110
const typeDefs = [];
111-
const typeExtsMap = Object.create(null);
111+
const typeExtensionsMap = Object.create(null);
112112

113113
// New directives and types are separate because a directives and types can
114114
// have the same name. For example, a type named "skip".
115115
const directiveDefs: Array<DirectiveDefinitionNode> = [];
116116

117117
let schemaDef: ?SchemaDefinitionNode;
118118
// Schema extensions are collected which may add additional operation types.
119-
const schemaExts: Array<SchemaExtensionNode> = [];
119+
const schemaExtensions: Array<SchemaExtensionNode> = [];
120120

121121
for (const def of documentAST.definitions) {
122122
if (def.kind === Kind.SCHEMA_DEFINITION) {
123123
schemaDef = def;
124124
} else if (def.kind === Kind.SCHEMA_EXTENSION) {
125-
schemaExts.push(def);
125+
schemaExtensions.push(def);
126126
} else if (isTypeDefinitionNode(def)) {
127127
typeDefs.push(def);
128128
} else if (isTypeExtensionNode(def)) {
129129
const extendedTypeName = def.name.value;
130-
const existingTypeExts = typeExtsMap[extendedTypeName];
131-
typeExtsMap[extendedTypeName] = existingTypeExts
132-
? existingTypeExts.concat([def])
130+
const existingTypeExtensions = typeExtensionsMap[extendedTypeName];
131+
typeExtensionsMap[extendedTypeName] = existingTypeExtensions
132+
? existingTypeExtensions.concat([def])
133133
: [def];
134134
} else if (def.kind === Kind.DIRECTIVE_DEFINITION) {
135135
directiveDefs.push(def);
@@ -139,10 +139,10 @@ export function extendSchema(
139139
// If this document contains no new types, extensions, or directives then
140140
// return the same unmodified GraphQLSchema instance.
141141
if (
142-
Object.keys(typeExtsMap).length === 0 &&
142+
Object.keys(typeExtensionsMap).length === 0 &&
143143
typeDefs.length === 0 &&
144144
directiveDefs.length === 0 &&
145-
schemaExts.length === 0 &&
145+
schemaExtensions.length === 0 &&
146146
!schemaDef
147147
) {
148148
return schema;
@@ -170,7 +170,7 @@ export function extendSchema(
170170
schemaConfig.subscription && replaceNamedType(schemaConfig.subscription),
171171
// Then, incorporate schema definition and all schema extensions.
172172
...astBuilder.getOperationTypes(
173-
concatMaybeArrays(schemaDef && [schemaDef], schemaExts) || [],
173+
concatMaybeArrays(schemaDef && [schemaDef], schemaExtensions) || [],
174174
),
175175
};
176176

@@ -185,7 +185,7 @@ export function extendSchema(
185185
astNode: schemaDef || schemaConfig.astNode,
186186
extensionASTNodes: concatMaybeArrays(
187187
schemaConfig.extensionASTNodes,
188-
schemaExts,
188+
schemaExtensions,
189189
),
190190
});
191191

@@ -248,7 +248,7 @@ export function extendSchema(
248248
type: GraphQLInputObjectType,
249249
): GraphQLInputObjectType {
250250
const config = type.toConfig();
251-
const extensions = typeExtsMap[config.name] || [];
251+
const extensions = typeExtensionsMap[config.name] || [];
252252

253253
return new GraphQLInputObjectType({
254254
...config,
@@ -269,7 +269,7 @@ export function extendSchema(
269269

270270
function extendEnumType(type: GraphQLEnumType): GraphQLEnumType {
271271
const config = type.toConfig();
272-
const extensions = typeExtsMap[type.name] || [];
272+
const extensions = typeExtensionsMap[type.name] || [];
273273

274274
return new GraphQLEnumType({
275275
...config,
@@ -287,7 +287,7 @@ export function extendSchema(
287287

288288
function extendScalarType(type: GraphQLScalarType): GraphQLScalarType {
289289
const config = type.toConfig();
290-
const extensions = typeExtsMap[config.name] || [];
290+
const extensions = typeExtensionsMap[config.name] || [];
291291

292292
return new GraphQLScalarType({
293293
...config,
@@ -300,7 +300,7 @@ export function extendSchema(
300300

301301
function extendObjectType(type: GraphQLObjectType): GraphQLObjectType {
302302
const config = type.toConfig();
303-
const extensions = typeExtsMap[config.name] || [];
303+
const extensions = typeExtensionsMap[config.name] || [];
304304

305305
return new GraphQLObjectType({
306306
...config,
@@ -324,7 +324,7 @@ export function extendSchema(
324324
type: GraphQLInterfaceType,
325325
): GraphQLInterfaceType {
326326
const config = type.toConfig();
327-
const extensions = typeExtsMap[config.name] || [];
327+
const extensions = typeExtensionsMap[config.name] || [];
328328

329329
return new GraphQLInterfaceType({
330330
...config,
@@ -346,7 +346,7 @@ export function extendSchema(
346346

347347
function extendUnionType(type: GraphQLUnionType): GraphQLUnionType {
348348
const config = type.toConfig();
349-
const extensions = typeExtsMap[config.name] || [];
349+
const extensions = typeExtensionsMap[config.name] || [];
350350

351351
return new GraphQLUnionType({
352352
...config,

src/validation/__tests__/KnownArgumentNames-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe('Validate: Known argument names', () => {
6767
it('no args on optional arg', () => {
6868
expectValid(`
6969
fragment noArgOnOptionalArg on Dog {
70-
isHousetrained
70+
isHouseTrained
7171
}
7272
`);
7373
});

src/validation/__tests__/ProvidedRequiredArguments-test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('Validate: Provided required arguments', () => {
3636
expectValid(`
3737
{
3838
dog {
39-
isHousetrained(unknownArgument: true)
39+
isHouseTrained(unknownArgument: true)
4040
}
4141
}
4242
`);
@@ -47,7 +47,7 @@ describe('Validate: Provided required arguments', () => {
4747
expectValid(`
4848
{
4949
dog {
50-
isHousetrained(atOtherHomes: true)
50+
isHouseTrained(atOtherHomes: true)
5151
}
5252
}
5353
`);
@@ -57,7 +57,7 @@ describe('Validate: Provided required arguments', () => {
5757
expectValid(`
5858
{
5959
dog {
60-
isHousetrained
60+
isHouseTrained
6161
}
6262
}
6363
`);
@@ -123,7 +123,7 @@ describe('Validate: Provided required arguments', () => {
123123
`);
124124
});
125125

126-
it('Multiple reqs on mixedList', () => {
126+
it('Multiple required args on mixedList', () => {
127127
expectValid(`
128128
{
129129
complicatedArgs {
@@ -133,7 +133,7 @@ describe('Validate: Provided required arguments', () => {
133133
`);
134134
});
135135

136-
it('Multiple reqs and one opt on mixedList', () => {
136+
it('Multiple required and one optional arg on mixedList', () => {
137137
expectValid(`
138138
{
139139
complicatedArgs {
@@ -143,7 +143,7 @@ describe('Validate: Provided required arguments', () => {
143143
`);
144144
});
145145

146-
it('All reqs and opts on mixedList', () => {
146+
it('All required and optional args on mixedList', () => {
147147
expectValid(`
148148
{
149149
complicatedArgs {

src/validation/__tests__/ValuesOfCorrectType-test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ describe('Validate: Values of correct type', () => {
627627
expectValid(`
628628
{
629629
dog {
630-
isHousetrained(atOtherHomes: true)
630+
isHouseTrained(atOtherHomes: true)
631631
}
632632
}
633633
`);
@@ -637,7 +637,7 @@ describe('Validate: Values of correct type', () => {
637637
expectValid(`
638638
{
639639
dog {
640-
isHousetrained
640+
isHouseTrained
641641
}
642642
}
643643
`);
@@ -693,7 +693,7 @@ describe('Validate: Values of correct type', () => {
693693
`);
694694
});
695695

696-
it('Multiple reqs on mixedList', () => {
696+
it('Multiple required args on mixedList', () => {
697697
expectValid(`
698698
{
699699
complicatedArgs {
@@ -703,7 +703,7 @@ describe('Validate: Values of correct type', () => {
703703
`);
704704
});
705705

706-
it('Multiple reqs and one opt on mixedList', () => {
706+
it('Multiple required and one optional arg on mixedList', () => {
707707
expectValid(`
708708
{
709709
complicatedArgs {
@@ -713,7 +713,7 @@ describe('Validate: Values of correct type', () => {
713713
`);
714714
});
715715

716-
it('All reqs and opts on mixedList', () => {
716+
it('All required and optional args on mixedList', () => {
717717
expectValid(`
718718
{
719719
complicatedArgs {

src/validation/__tests__/harness.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ const Dog = new GraphQLObjectType({
113113
dogCommand: { type: DogCommand },
114114
},
115115
},
116-
isHousetrained: {
116+
isHouseTrained: {
117117
type: GraphQLBoolean,
118118
args: {
119119
atOtherHomes: {

src/validation/__tests__/validation-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('Validate: Supports full validation', () => {
1919
furColor
2020
}
2121
... on Dog {
22-
isHousetrained
22+
isHouseTrained
2323
}
2424
}
2525
}
@@ -58,7 +58,7 @@ describe('Validate: Supports full validation', () => {
5858
furColor
5959
}
6060
... on Dog {
61-
isHousetrained
61+
isHouseTrained
6262
}
6363
}
6464
}
@@ -70,7 +70,7 @@ describe('Validate: Supports full validation', () => {
7070
expect(errorMessages).to.deep.equal([
7171
'Cannot query field "catOrDog" on type "QueryRoot". Did you mean "catOrDog"?',
7272
'Cannot query field "furColor" on type "Cat". Did you mean "furColor"?',
73-
'Cannot query field "isHousetrained" on type "Dog". Did you mean "isHousetrained"?',
73+
'Cannot query field "isHouseTrained" on type "Dog". Did you mean "isHouseTrained"?',
7474
]);
7575
});
7676
});

0 commit comments

Comments
 (0)