Skip to content

Commit 0f784fd

Browse files
committed
s/Array/List/
1 parent 92fe8d2 commit 0f784fd

File tree

11 files changed

+28
-28
lines changed

11 files changed

+28
-28
lines changed

src/executor/__tests__/variables.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ describe('Execute: Handles inputs', () => {
104104
});
105105
});
106106

107-
it('properly coerces single value to array', async () => {
107+
it('properly coerces single value to list', async () => {
108108
var doc = `
109109
{
110110
fieldWithObjectInput(input: {a: "foo", b: "bar", c: "baz"})
@@ -173,7 +173,7 @@ describe('Execute: Handles inputs', () => {
173173
});
174174
});
175175

176-
it('properly coerces single value to array', async () => {
176+
it('properly coerces single value to list', async () => {
177177
var params = {input: {a: 'foo', b: 'bar', c: 'baz'}};
178178
var result = await execute(schema, ast, null, params);
179179

src/executor/executor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ function resolveField(
473473

474474
// Build a JS object of arguments from the field.arguments AST, using the
475475
// variables scope to fulfill any variable references.
476-
// TODO: find a way to memoize, in case this field is within a Array type.
476+
// TODO: find a way to memoize, in case this field is within a List type.
477477
var args = fieldDef.args ?
478478
getArgumentValues(fieldDef.args, fieldAST.arguments, exeContext.variables) :
479479
null;

src/executor/values.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import type {
2929
Argument,
3030
VariableDefinition,
3131
Variable,
32-
ArrayValue,
32+
ListValue,
3333
ObjectValue
3434
} from '../language/ast';
3535

@@ -243,8 +243,8 @@ export function coerceValueAST(
243243

244244
if (type instanceof GraphQLList) {
245245
var itemType = type.ofType;
246-
if (valueAST.kind === Kind.ARRAY) {
247-
return (valueAST: ArrayValue).values.map(
246+
if (valueAST.kind === Kind.LIST) {
247+
return (valueAST: ListValue).values.map(
248248
itemAST => coerceValueAST(itemType, itemAST, variables)
249249
);
250250
} else {

src/language/__tests__/visitor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,12 @@ describe('Visitor', () => {
245245
[ 'enter', 'Argument', 0, undefined ],
246246
[ 'enter', 'Name', 'name', 'Argument' ],
247247
[ 'leave', 'Name', 'name', 'Argument' ],
248-
[ 'enter', 'ArrayValue', 'value', 'Argument' ],
248+
[ 'enter', 'ListValue', 'value', 'Argument' ],
249249
[ 'enter', 'IntValue', 0, undefined ],
250250
[ 'leave', 'IntValue', 0, undefined ],
251251
[ 'enter', 'IntValue', 1, undefined ],
252252
[ 'leave', 'IntValue', 1, undefined ],
253-
[ 'leave', 'ArrayValue', 'value', 'Argument' ],
253+
[ 'leave', 'ListValue', 'value', 'Argument' ],
254254
[ 'leave', 'Argument', 0, undefined ],
255255
[ 'enter', 'SelectionSet', 'selectionSet', 'Field' ],
256256
[ 'enter', 'Field', 0, undefined ],

src/language/ast.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export type Node = Name
4040
| StringValue
4141
| BooleanValue
4242
| EnumValue
43-
| ArrayValue
43+
| ListValue
4444
| ObjectValue
4545
| ObjectField
4646
| Directive
@@ -153,7 +153,7 @@ export type Value = Variable
153153
| StringValue
154154
| BooleanValue
155155
| EnumValue
156-
| ArrayValue
156+
| ListValue
157157
| ObjectValue
158158

159159
export type IntValue = {
@@ -186,8 +186,8 @@ export type EnumValue = {
186186
value: string;
187187
}
188188

189-
export type ArrayValue = {
190-
kind: 'ArrayValue';
189+
export type ListValue = {
190+
kind: 'ListValue';
191191
loc?: ?Location;
192192
values: Array<Value>;
193193
}

src/language/kinds.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const FLOAT = 'FloatValue';
3434
export const STRING = 'StringValue';
3535
export const BOOLEAN = 'BooleanValue';
3636
export const ENUM = 'EnumValue';
37-
export const ARRAY = 'ArrayValue';
37+
export const LIST = 'ListValue';
3838
export const OBJECT = 'ObjectValue';
3939
export const OBJECT_FIELD = 'ObjectField';
4040

src/language/parser.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import type {
2727
FragmentDefinition,
2828

2929
Value,
30-
ArrayValue,
30+
ListValue,
3131
ObjectValue,
3232
ObjectField,
3333

@@ -57,7 +57,7 @@ import {
5757
STRING,
5858
BOOLEAN,
5959
ENUM,
60-
ARRAY,
60+
LIST,
6161
OBJECT,
6262
OBJECT_FIELD,
6363

@@ -319,7 +319,7 @@ function parseValue(parser, isConst: boolean): Value {
319319
var token = parser.token;
320320
switch (token.kind) {
321321
case TokenKind.BRACKET_L:
322-
return parseArray(parser, isConst);
322+
return parseList(parser, isConst);
323323
case TokenKind.BRACE_L:
324324
return parseObject(parser, isConst);
325325
case TokenKind.INT:
@@ -369,11 +369,11 @@ function parseValue(parser, isConst: boolean): Value {
369369
throw unexpected(parser);
370370
}
371371

372-
function parseArray(parser, isConst: boolean): ArrayValue {
372+
function parseList(parser, isConst: boolean): ListValue {
373373
var start = parser.token.start;
374374
var item = isConst ? parseConstValue : parseVariableValue;
375375
return {
376-
kind: ARRAY,
376+
kind: LIST,
377377
values: any(parser, TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),
378378
loc: loc(parser, start)
379379
};

src/language/printer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function print(ast) {
7979
StringValue: node => JSON.stringify(node.value),
8080
BooleanValue: node => node.value ? 'true' : 'false',
8181
EnumValue: node => node.value,
82-
ArrayValue: node => '[' + join(node.values, ', ') + ']',
82+
ListValue: node => '[' + join(node.values, ', ') + ']',
8383
ObjectValue: node => '{' + join(node.fields, ', ') + '}',
8484
ObjectField: node => node.name + ': ' + node.value,
8585

src/language/visitor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export var VisitorKeys = {
2828
StringValue: [],
2929
BooleanValue: [],
3030
EnumValue: [],
31-
ArrayValue: ['values'],
31+
ListValue: ['values'],
3232
ObjectValue: ['fields'],
3333
ObjectField: ['name', 'value'],
3434

src/utils/TypeInfo.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ export default class TypeInfo {
154154
this._argument = argDef;
155155
this._inputTypeStack.push(argType);
156156
break;
157-
case Kind.ARRAY:
158-
var arrayType = getNullableType(this.getInputType());
157+
case Kind.LIST:
158+
var listType = getNullableType(this.getInputType());
159159
this._inputTypeStack.push(
160-
arrayType instanceof GraphQLList ? arrayType.ofType : undefined
160+
listType instanceof GraphQLList ? listType.ofType : undefined
161161
);
162162
break;
163163
case Kind.OBJECT_FIELD:
@@ -196,7 +196,7 @@ export default class TypeInfo {
196196
this._argument = null;
197197
this._inputTypeStack.pop();
198198
break;
199-
case Kind.ARRAY:
199+
case Kind.LIST:
200200
case Kind.OBJECT_FIELD:
201201
this._inputTypeStack.pop();
202202
break;

0 commit comments

Comments
 (0)