Skip to content

Commit a311f4e

Browse files
committed
feat: improve hoisting tenacity
BREAKING CHANGE: min required `graphql-compose` version is `4.0.0`
1 parent 06ac0b8 commit a311f4e

File tree

4 files changed

+59
-49
lines changed

4 files changed

+59
-49
lines changed

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
},
2323
"homepage": "https://github.com/graphql-compose/graphql-compose-relay",
2424
"peerDependencies": {
25-
"graphql-compose": ">=2.9.5 || >=3.0.0"
25+
"graphql-compose": ">=4.0.0"
2626
},
2727
"devDependencies": {
2828
"babel-cli": "^6.26.0",
29-
"babel-eslint": "^8.2.2",
29+
"babel-eslint": "^8.2.3",
3030
"babel-jest": "^22.4.3",
3131
"babel-plugin-transform-flow-strip-types": "^6.22.0",
3232
"babel-plugin-transform-object-rest-spread": "^6.26.0",
@@ -36,16 +36,16 @@
3636
"eslint": "^4.19.1",
3737
"eslint-config-airbnb-base": "^12.1.0",
3838
"eslint-config-prettier": "^2.9.0",
39-
"eslint-plugin-flowtype": "^2.46.1",
40-
"eslint-plugin-import": "^2.10.0",
39+
"eslint-plugin-flowtype": "^2.46.2",
40+
"eslint-plugin-import": "^2.11.0",
4141
"eslint-plugin-prettier": "^2.6.0",
42-
"flow-bin": "^0.69.0",
42+
"flow-bin": "^0.70.0",
4343
"graphql": "0.13.2",
44-
"graphql-compose": "^3.1.1",
44+
"graphql-compose": "^4.0.0",
4545
"jest": "^22.4.3",
46-
"prettier": "^1.11.1",
46+
"prettier": "^1.12.0",
4747
"rimraf": "^2.6.2",
48-
"semantic-release": "^15.1.4"
48+
"semantic-release": "^15.1.7"
4949
},
5050
"dependencies": {
5151
"babel-runtime": "^6.26.0"

src/__tests__/composeWithRelay-test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ describe('composeWithRelay', () => {
5454

5555
describe('when pass User type composer (not RootQuery)', () => {
5656
it('should add or override id field', () => {
57-
const idField = userComposer.getField('id');
57+
const idField = userComposer.getFieldConfig('id');
5858
expect(idField.description).toContain('globally unique ID');
5959
});
6060

6161
it('should make id field NonNull', () => {
62-
const idField = userComposer.getField('id');
62+
const idField = userComposer.getFieldConfig('id');
6363
expect(idField.type).toBeInstanceOf(GraphQLNonNull);
6464
});
6565

src/wrapMutationResolver.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export default function wrapMutationResolver(
2828

2929
function prepareArgs(newResolver: Resolver) {
3030
let ITC: InputTypeComposer;
31-
if (newResolver.args.input && newResolver.args.input.type) {
32-
const inputNamedType = getNamedType(newResolver.args.input.type);
31+
if (newResolver.hasArg('input')) {
32+
const inputNamedType = getNamedType(newResolver.getArgType('input'));
3333
if (inputNamedType instanceof GraphQLInputObjectType) {
3434
ITC = new InputTypeComposer(inputNamedType);
3535
}
@@ -42,9 +42,8 @@ export default function wrapMutationResolver(
4242
});
4343
newResolver.setArgs({
4444
input: {
45-
name: 'input',
4645
// nonNull due required arg clientMutationId
47-
type: new GraphQLNonNull(ITC.getType()),
46+
type: () => new GraphQLNonNull(ITC.getType()),
4847
},
4948
});
5049
// $FlowFixMe

yarn.lock

+46-35
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# yarn lockfile v1
33

44

5-
"@babel/code-frame@7.0.0-beta.44", "@babel/code-frame@^7.0.0-beta.40":
5+
"@babel/code-frame@7.0.0-beta.44":
66
version "7.0.0-beta.44"
77
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz#2a02643368de80916162be70865c97774f3adbd9"
88
dependencies:
@@ -63,7 +63,7 @@
6363
babylon "7.0.0-beta.44"
6464
lodash "^4.2.0"
6565

66-
"@babel/traverse@^7.0.0-beta.40":
66+
"@babel/traverse@7.0.0-beta.44":
6767
version "7.0.0-beta.44"
6868
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.44.tgz#a970a2c45477ad18017e2e465a0606feee0d2966"
6969
dependencies:
@@ -78,7 +78,7 @@
7878
invariant "^2.2.0"
7979
lodash "^4.2.0"
8080

81-
"@babel/types@7.0.0-beta.44", "@babel/types@^7.0.0-beta.40":
81+
"@babel/types@7.0.0-beta.44":
8282
version "7.0.0-beta.44"
8383
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.44.tgz#6b1b164591f77dec0a0342aca995f2d046b3a757"
8484
dependencies:
@@ -488,14 +488,14 @@ babel-core@^6.0.0, babel-core@^6.26.0:
488488
slash "^1.0.0"
489489
source-map "^0.5.6"
490490

491-
babel-eslint@^8.2.2:
492-
version "8.2.2"
493-
resolved "http://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.2.tgz#1102273354c6f0b29b4ea28a65f97d122296b68b"
491+
babel-eslint@^8.2.3:
492+
version "8.2.3"
493+
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.3.tgz#1a2e6681cc9bc4473c32899e59915e19cd6733cf"
494494
dependencies:
495-
"@babel/code-frame" "^7.0.0-beta.40"
496-
"@babel/traverse" "^7.0.0-beta.40"
497-
"@babel/types" "^7.0.0-beta.40"
498-
babylon "^7.0.0-beta.40"
495+
"@babel/code-frame" "7.0.0-beta.44"
496+
"@babel/traverse" "7.0.0-beta.44"
497+
"@babel/types" "7.0.0-beta.44"
498+
babylon "7.0.0-beta.44"
499499
eslint-scope "~3.7.1"
500500
eslint-visitor-keys "^1.0.0"
501501

@@ -983,7 +983,7 @@ babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26
983983
lodash "^4.17.4"
984984
to-fast-properties "^1.0.3"
985985

986-
babylon@7.0.0-beta.44, babylon@^7.0.0-beta.40:
986+
babylon@7.0.0-beta.44:
987987
version "7.0.0-beta.44"
988988
resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.44.tgz#89159e15e6e30c5096e22d738d8c0af8a0e8ca1d"
989989

@@ -1112,7 +1112,7 @@ buffer-shims@^1.0.0:
11121112
version "1.0.0"
11131113
resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51"
11141114

1115-
builtin-modules@^1.0.0, builtin-modules@^1.1.1:
1115+
builtin-modules@^1.0.0:
11161116
version "1.1.1"
11171117
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
11181118

@@ -1730,17 +1730,16 @@ eslint-module-utils@^2.2.0:
17301730
debug "^2.6.8"
17311731
pkg-dir "^1.0.0"
17321732

1733-
eslint-plugin-flowtype@^2.46.1:
1734-
version "2.46.1"
1735-
resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.46.1.tgz#c4f81d580cd89c82bc3a85a1ccf4ae3a915143a4"
1733+
eslint-plugin-flowtype@^2.46.2:
1734+
version "2.46.2"
1735+
resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.46.2.tgz#8749fddda6f6c30d0672011151bea726765b5753"
17361736
dependencies:
17371737
lodash "^4.15.0"
17381738

1739-
eslint-plugin-import@^2.10.0:
1740-
version "2.10.0"
1741-
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.10.0.tgz#fa09083d5a75288df9c6c7d09fe12255985655e7"
1739+
eslint-plugin-import@^2.11.0:
1740+
version "2.11.0"
1741+
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.11.0.tgz#15aeea37a67499d848e8e981806d4627b5503816"
17421742
dependencies:
1743-
builtin-modules "^1.1.1"
17441743
contains-path "^0.1.0"
17451744
debug "^2.6.8"
17461745
doctrine "1.5.0"
@@ -1750,6 +1749,7 @@ eslint-plugin-import@^2.10.0:
17501749
lodash "^4.17.4"
17511750
minimatch "^3.0.3"
17521751
read-pkg-up "^2.0.0"
1752+
resolve "^1.6.0"
17531753

17541754
eslint-plugin-prettier@^2.6.0:
17551755
version "2.6.0"
@@ -2082,9 +2082,9 @@ flat-cache@^1.2.1:
20822082
graceful-fs "^4.1.2"
20832083
write "^0.2.1"
20842084

2085-
flow-bin@^0.69.0:
2086-
version "0.69.0"
2087-
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.69.0.tgz#053159a684a6051fcbf0b71a2eb19a9679082da6"
2085+
flow-bin@^0.70.0:
2086+
version "0.70.0"
2087+
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.70.0.tgz#080ae83a997f2b4ddb3dc2649bf13336825292b5"
20882088

20892089
for-in@^1.0.1, for-in@^1.0.2:
20902090
version "1.0.2"
@@ -2284,11 +2284,12 @@ git-url-parse@^8.0.0:
22842284
dependencies:
22852285
git-up "^2.0.0"
22862286

2287-
git-url-parse@^8.1.0:
2288-
version "8.2.0"
2289-
resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-8.2.0.tgz#74969b0105f805df58873ee5b96bc1a4dc0573b1"
2287+
git-url-parse@^9.0.0:
2288+
version "9.0.0"
2289+
resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-9.0.0.tgz#a82a36acc3544c77ed0984d6488b37fbcfbec24d"
22902290
dependencies:
22912291
git-up "^2.0.0"
2292+
parse-domain "^2.0.0"
22922293

22932294
glob-base@^0.3.0:
22942295
version "0.3.0"
@@ -2364,9 +2365,9 @@ graceful-fs@^4.1.4:
23642365
version "4.1.9"
23652366
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.9.tgz#baacba37d19d11f9d146d3578bc99958c3787e29"
23662367

2367-
graphql-compose@^3.1.1:
2368-
version "3.1.1"
2369-
resolved "https://registry.yarnpkg.com/graphql-compose/-/graphql-compose-3.1.1.tgz#97fcf4f4a0aa5d58906eb9ec4166cbf426437c73"
2368+
graphql-compose@^4.0.0:
2369+
version "4.0.0"
2370+
resolved "https://registry.yarnpkg.com/graphql-compose/-/graphql-compose-4.0.0.tgz#6b260dc4e220c33feae46e50e34edd9072ef0244"
23702371
dependencies:
23712372
babel-runtime "^6.26.0"
23722373
object-path "^0.11.4"
@@ -4016,6 +4017,10 @@ p-retry@^1.0.0:
40164017
dependencies:
40174018
retry "^0.10.0"
40184019

4020+
parse-domain@^2.0.0:
4021+
version "2.0.0"
4022+
resolved "https://registry.yarnpkg.com/parse-domain/-/parse-domain-2.0.0.tgz#e9f42f697c30f7c2051dc5c55ff4d8a80da7943c"
4023+
40194024
parse-github-url@^1.0.1:
40204025
version "1.0.2"
40214026
resolved "https://registry.yarnpkg.com/parse-github-url/-/parse-github-url-1.0.2.tgz#242d3b65cbcdda14bb50439e3242acf6971db395"
@@ -4169,9 +4174,9 @@ preserve@^0.2.0:
41694174
version "0.2.0"
41704175
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
41714176

4172-
prettier@^1.11.1:
4173-
version "1.11.1"
4174-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.11.1.tgz#61e43fc4cd44e68f2b0dfc2c38cd4bb0fccdcc75"
4177+
prettier@^1.12.0:
4178+
version "1.12.0"
4179+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.12.0.tgz#d26fc5894b9230de97629b39cae225b503724ce8"
41754180

41764181
pretty-format@^22.4.3:
41774182
version "22.4.3"
@@ -4603,6 +4608,12 @@ resolve@^1.2.0:
46034608
dependencies:
46044609
path-parse "^1.0.5"
46054610

4611+
resolve@^1.6.0:
4612+
version "1.7.1"
4613+
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.7.1.tgz#aadd656374fd298aee895bc026b8297418677fd3"
4614+
dependencies:
4615+
path-parse "^1.0.5"
4616+
46064617
restore-cursor@^2.0.0:
46074618
version "2.0.0"
46084619
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
@@ -4684,9 +4695,9 @@ sax@^1.2.4:
46844695
version "1.2.4"
46854696
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
46864697

4687-
semantic-release@^15.1.4:
4688-
version "15.1.4"
4689-
resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-15.1.4.tgz#000ddbd8a8977dc1a68cacfbeef2fb551e4b9791"
4698+
semantic-release@^15.1.7:
4699+
version "15.1.7"
4700+
resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-15.1.7.tgz#b29eef1b9443f75addab7c2e353338b72b9b628d"
46904701
dependencies:
46914702
"@semantic-release/commit-analyzer" "^5.0.0"
46924703
"@semantic-release/error" "^2.2.0"
@@ -4701,7 +4712,7 @@ semantic-release@^15.1.4:
47014712
execa "^0.10.0"
47024713
get-stream "^3.0.0"
47034714
git-log-parser "^1.2.0"
4704-
git-url-parse "^8.1.0"
4715+
git-url-parse "^9.0.0"
47054716
hook-std "^0.4.0"
47064717
hosted-git-info "^2.6.0"
47074718
lodash "^4.17.4"

0 commit comments

Comments
 (0)