Skip to content

Commit 05934ef

Browse files
authored
Merge pull request #16 from sleepycat/support_twelve_dot_oh
Update location of DirectiveLocation
2 parents 2859100 + 3fe77d9 commit 05934ef

File tree

7 files changed

+11
-10
lines changed

7 files changed

+11
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"coveralls": "^2.11.14",
5151
"eslint": "^3.8.0",
5252
"eslint-config-google": "^0.6.0",
53-
"graphql": "^0.10.1",
53+
"graphql": "^0.12.0",
5454
"mocha": "^3.1.2",
5555
"nyc": "^8.3.1"
5656
}

src/directives/currency.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { GraphQLString } from 'graphql';
2-
import { DirectiveLocation } from 'graphql/type/directives';
2+
import { DirectiveLocation } from 'graphql/language/directiveLocation';
33
import { GraphQLCustomDirective } from '../custom';
44

55
import numeral from 'numeral';

src/directives/date.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { GraphQLString, GraphQLBoolean } from 'graphql';
2-
import { DirectiveLocation } from 'graphql/type/directives';
2+
import { DirectiveLocation } from 'graphql/language/directiveLocation';
33
import { GraphQLCustomDirective } from '../custom';
44
import { _ } from 'lodash';
55

@@ -64,4 +64,4 @@ exports.GraphQLTimeOffsetDirective = new GraphQLCustomDirective({
6464
}
6565
});
6666
}
67-
});
67+
});

src/directives/number.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { GraphQLString } from 'graphql';
2-
import { DirectiveLocation } from 'graphql/type/directives';
2+
import { DirectiveLocation } from 'graphql/language/directiveLocation';
33
import { GraphQLCustomDirective } from '../custom';
44

55
import numeral from 'numeral';

src/directives/string.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DirectiveLocation } from 'graphql/type/directives';
1+
import { DirectiveLocation } from 'graphql/language/directiveLocation';
22
import { GraphQLString, GraphQLNonNull } from 'graphql';
33
import { GraphQLCustomDirective } from '../custom';
44

@@ -78,4 +78,4 @@ exports.GraphQLTemplateDirective = new GraphQLCustomDirective({
7878
return output;
7979
});
8080
}
81-
});
81+
});

test/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { GraphQLCustomDirective, applySchemaCustomDirectives } from '../src/index';
22
import { GraphQLInt, GraphQLSchema, GraphQLObjectType, GraphQLNonNull, GraphQLList, graphql, buildSchema } from 'graphql';
3-
import { DirectiveLocation } from 'graphql/type/directives';
3+
import { DirectiveLocation } from 'graphql/language/directiveLocation';
44
import { createGraphQLQueryDeepObject, testEqual, testNullEqual } from './utils';
55

66
import { expect } from 'chai';

test/utils.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const DEFAULT_TEST_SCHEMA = `type Query { value(input: String): String } schema
77

88
exports.testEqual = function({ directives, query, schema, input, passServer = false, expected, done, context }) {
99

10+
1011
let executionSchema = buildSchema(schema || DEFAULT_TEST_SCHEMA);
1112

1213
if (!schema) {
@@ -16,14 +17,14 @@ exports.testEqual = function({ directives, query, schema, input, passServer = fa
1617
}
1718
}
1819

19-
executionSchema._directives = executionSchema._directives.concat(directives);
20+
if (directives)
21+
executionSchema._directives = executionSchema._directives.concat(directives);
2022

2123
applySchemaCustomDirectives(executionSchema);
2224

2325
graphql(executionSchema, query, input, context)
2426
.then(({data, errors }) => {
2527
if (errors) {
26-
console.error(errors);
2728
throw new Error(errors);
2829
}
2930
expect(data).to.eql(expected);

0 commit comments

Comments
 (0)