Skip to content

Commit f47d05c

Browse files
committed
Upgrade graphql-js version to v14.0.0, fixes #13
1 parent 1572850 commit f47d05c

File tree

4 files changed

+153
-141
lines changed

4 files changed

+153
-141
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"lodash.get": "^4.4.2"
2121
},
2222
"peerDependencies": {
23-
"graphql": "^0.13.2"
23+
"graphql": "^14.0.0"
2424
},
2525
"files": [
2626
"dist",
@@ -37,13 +37,13 @@
3737
"devDependencies": {
3838
"@types/assert": "^0.0.31",
3939
"@types/chai": "^4.1.4",
40-
"@types/graphql": "^0.13.4",
40+
"@types/graphql": "^14.0.0",
4141
"@types/lodash.get": "^4.4.4",
4242
"@types/mocha": "^5.2.5",
4343
"chai": "^4.1.0",
4444
"eslint": "^5.4.0",
4545
"eslint-plugin-typescript": "^0.12.0",
46-
"graphql": "^0.13.2",
46+
"graphql": "^14.0.0",
4747
"mocha": "^5.2.0",
4848
"rimraf": "^2.6.1",
4949
"ts-node": "^7.0.1",

src/estimators/directive/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ const rule = queryComplexity({
2525
Define your schema and add the complexity directive:
2626

2727
```graphql
28+
directive @complexity(
29+
# The complexity value for the field
30+
value: Int!,
31+
32+
# Optional multipliers
33+
multipliers: [String!]
34+
) on FIELD_DEFINITION
35+
36+
2837
type Query {
2938
# Fixed complexity of 5
3039
someField: String @complexity(value: 5)

src/estimators/directive/__tests__/fixtures/schema.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ import {
77
} from 'graphql';
88

99
export default buildSchema(`
10+
directive @cost(
11+
value: Int!,
12+
multipliers: [String!]
13+
) on FIELD_DEFINITION
14+
15+
directive @complexity(
16+
value: Int!,
17+
multipliers: [String!]
18+
) on FIELD_DEFINITION
19+
1020
type Query {
1121
scalar: String @complexity(value: 5)
1222
negativeCostScalar: String @complexity(value: -20)

0 commit comments

Comments
 (0)