Skip to content

Commit 5e9c79a

Browse files
committed
Merge branch 'master' of github.com:graphql/graphql-js
2 parents f9cd233 + 5261658 commit 5e9c79a

File tree

9 files changed

+23
-17
lines changed

9 files changed

+23
-17
lines changed

.eslintrc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"parser": "babel-eslint",
33

4+
"plugins": [
5+
"babel"
6+
],
7+
48
"env": {
59
"es6": true,
610
"node": true
@@ -34,8 +38,9 @@
3438
},
3539

3640
"rules": {
41+
"babel/arrow-parens": [2, "as-needed"],
42+
3743
"array-bracket-spacing": [2, "always"],
38-
"arrow-parens": [0, "as-needed"],
3944
"arrow-spacing": 2,
4045
"block-scoped-var": 0,
4146
"brace-style": [2, "1tbs", {"allowSingleLine": true}],

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@
4343
"devDependencies": {
4444
"babel": "5.8.21",
4545
"babel-core": "5.8.22",
46-
"babel-eslint": "4.0.5",
46+
"babel-eslint": "4.0.10",
4747
"bluebird": "2.9.34",
4848
"chai": "3.2.0",
4949
"chai-subset": "1.0.1",
5050
"coveralls": "2.11.3",
5151
"eslint": "1.1.0",
52+
"eslint-plugin-babel": "^2.1.1",
5253
"flow-bin": "0.14.0",
5354
"isparta": "3.0.3",
5455
"minimist": "1.1.3",

src/__tests__/starWarsSchema.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ var characterInterface = new GraphQLInterfaceType({
126126
description: 'Which movies they appear in.',
127127
},
128128
}),
129-
resolveType: (character) => {
129+
resolveType: character => {
130130
return getHuman(character.id) ? humanType : droidType;
131131
}
132132
});
@@ -158,7 +158,7 @@ var humanType = new GraphQLObjectType({
158158
type: new GraphQLList(characterInterface),
159159
description: 'The friends of the human, or an empty list if they ' +
160160
'have none.',
161-
resolve: (human) => getFriends(human),
161+
resolve: human => getFriends(human),
162162
},
163163
appearsIn: {
164164
type: new GraphQLList(episodeEnum),
@@ -200,7 +200,7 @@ var droidType = new GraphQLObjectType({
200200
type: new GraphQLList(characterInterface),
201201
description: 'The friends of the droid, or an empty list if they ' +
202202
'have none.',
203-
resolve: (droid) => getFriends(droid),
203+
resolve: droid => getFriends(droid),
204204
},
205205
appearsIn: {
206206
type: new GraphQLList(episodeEnum),

src/execution/__tests__/nonnull.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ var throwingData = {
5151
},
5252
promiseNest() {
5353
return new Promise(
54-
(resolve) => {
54+
resolve => {
5555
resolve(throwingData);
5656
}
5757
);
5858
},
5959
nonNullPromiseNest() {
6060
return new Promise(
61-
(resolve) => {
61+
resolve => {
6262
resolve(throwingData);
6363
}
6464
);
@@ -70,14 +70,14 @@ var nullingData = {
7070
nonNullSync() { return null; },
7171
promise() {
7272
return new Promise(
73-
(resolve) => {
73+
resolve => {
7474
resolve(null);
7575
}
7676
);
7777
},
7878
nonNullPromise() {
7979
return new Promise(
80-
(resolve) => {
80+
resolve => {
8181
resolve(null);
8282
}
8383
);
@@ -90,14 +90,14 @@ var nullingData = {
9090
},
9191
promiseNest() {
9292
return new Promise(
93-
(resolve) => {
93+
resolve => {
9494
resolve(nullingData);
9595
}
9696
);
9797
},
9898
nonNullPromiseNest() {
9999
return new Promise(
100-
(resolve) => {
100+
resolve => {
101101
resolve(nullingData);
102102
}
103103
);

src/execution/execute.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ function executeFieldsSerially(
250250
fields: {[key: string]: Array<Field>}
251251
): Promise<Object> {
252252
return Object.keys(fields).reduce(
253-
(prevPromise, responseName) => prevPromise.then((results) => {
253+
(prevPromise, responseName) => prevPromise.then(results => {
254254
var fieldASTs = fields[responseName];
255255
var result = resolveField(exeContext, parentType, sourceValue, fieldASTs);
256256
if (result === undefined) {

src/language/__tests__/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ fragment MissingOn Type
149149
'true',
150150
'false'
151151
];
152-
nonKeywords.forEach((keyword) => {
152+
nonKeywords.forEach(keyword => {
153153
let fragmentName = keyword;
154154
// You can't define or reference a fragment named `on`.
155155
if (keyword === 'on') {

src/type/__tests__/definition.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ describe('Type System: Example', () => {
302302
EnumType,
303303
InputObjectType
304304
];
305-
badUnionTypes.forEach((x) => {
305+
badUnionTypes.forEach(x => {
306306
expect(() =>
307307
new GraphQLUnionType({ name: 'BadUnion', types: [ x ] })
308308
).to.throw(

src/type/definition.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ export type GraphQLInterfaceTypeConfig = {
595595
fields: GraphQLFieldConfigMapThunk | GraphQLFieldConfigMap,
596596
/**
597597
* Optionally provide a custom type resolver function. If one is not provided,
598-
* the default implemenation will call `isTypeOf` on each implementing
598+
* the default implementation will call `isTypeOf` on each implementing
599599
* Object type.
600600
*/
601601
resolveType?: (value: any, info?: GraphQLResolveInfo) => ?GraphQLObjectType,
@@ -701,7 +701,7 @@ export type GraphQLUnionTypeConfig = {
701701
types: Array<GraphQLObjectType>,
702702
/**
703703
* Optionally provide a custom type resolver function. If one is not provided,
704-
* the default implemenation will call `isTypeOf` on each implementing
704+
* the default implementation will call `isTypeOf` on each implementing
705705
* Object type.
706706
*/
707707
resolveType?: (value: any, info?: GraphQLResolveInfo) => ?GraphQLObjectType;

src/utilities/buildASTSchema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export function buildASTSchema(
126126
ID: GraphQLID,
127127
};
128128

129-
return (typeAST) => {
129+
return typeAST => {
130130
var typeName = getInnerTypeName(typeAST);
131131
if (!isNullish(innerTypeMap[typeName])) {
132132
return buildWrappedType(innerTypeMap[typeName], typeAST);

0 commit comments

Comments
 (0)