Skip to content

Commit

Permalink
feat: improve hoisting tenacity
Browse files Browse the repository at this point in the history
BREAKING CHANGE: min required `graphql-compose` version is `4.0.0`
  • Loading branch information
nodkz committed Apr 16, 2018
1 parent 06ac0b8 commit a311f4e
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 49 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
},
"homepage": "https://github.com/graphql-compose/graphql-compose-relay",
"peerDependencies": {
"graphql-compose": ">=2.9.5 || >=3.0.0"
"graphql-compose": ">=4.0.0"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-eslint": "^8.2.2",
"babel-eslint": "^8.2.3",
"babel-jest": "^22.4.3",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
Expand All @@ -36,16 +36,16 @@
"eslint": "^4.19.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-flowtype": "^2.46.1",
"eslint-plugin-import": "^2.10.0",
"eslint-plugin-flowtype": "^2.46.2",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-prettier": "^2.6.0",
"flow-bin": "^0.69.0",
"flow-bin": "^0.70.0",
"graphql": "0.13.2",
"graphql-compose": "^3.1.1",
"graphql-compose": "^4.0.0",
"jest": "^22.4.3",
"prettier": "^1.11.1",
"prettier": "^1.12.0",
"rimraf": "^2.6.2",
"semantic-release": "^15.1.4"
"semantic-release": "^15.1.7"
},
"dependencies": {
"babel-runtime": "^6.26.0"
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/composeWithRelay-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ describe('composeWithRelay', () => {

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

it('should make id field NonNull', () => {
const idField = userComposer.getField('id');
const idField = userComposer.getFieldConfig('id');
expect(idField.type).toBeInstanceOf(GraphQLNonNull);
});

Expand Down
7 changes: 3 additions & 4 deletions src/wrapMutationResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export default function wrapMutationResolver(

function prepareArgs(newResolver: Resolver) {
let ITC: InputTypeComposer;
if (newResolver.args.input && newResolver.args.input.type) {
const inputNamedType = getNamedType(newResolver.args.input.type);
if (newResolver.hasArg('input')) {
const inputNamedType = getNamedType(newResolver.getArgType('input'));
if (inputNamedType instanceof GraphQLInputObjectType) {
ITC = new InputTypeComposer(inputNamedType);
}
Expand All @@ -42,9 +42,8 @@ export default function wrapMutationResolver(
});
newResolver.setArgs({
input: {
name: 'input',
// nonNull due required arg clientMutationId
type: new GraphQLNonNull(ITC.getType()),
type: () => new GraphQLNonNull(ITC.getType()),
},
});
// $FlowFixMe
Expand Down
81 changes: 46 additions & 35 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# yarn lockfile v1


"@babel/code-frame@7.0.0-beta.44", "@babel/code-frame@^7.0.0-beta.40":
"@babel/code-frame@7.0.0-beta.44":
version "7.0.0-beta.44"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz#2a02643368de80916162be70865c97774f3adbd9"
dependencies:
Expand Down Expand Up @@ -63,7 +63,7 @@
babylon "7.0.0-beta.44"
lodash "^4.2.0"

"@babel/traverse@^7.0.0-beta.40":
"@babel/traverse@7.0.0-beta.44":
version "7.0.0-beta.44"
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.44.tgz#a970a2c45477ad18017e2e465a0606feee0d2966"
dependencies:
Expand All @@ -78,7 +78,7 @@
invariant "^2.2.0"
lodash "^4.2.0"

"@babel/types@7.0.0-beta.44", "@babel/types@^7.0.0-beta.40":
"@babel/types@7.0.0-beta.44":
version "7.0.0-beta.44"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.44.tgz#6b1b164591f77dec0a0342aca995f2d046b3a757"
dependencies:
Expand Down Expand Up @@ -488,14 +488,14 @@ babel-core@^6.0.0, babel-core@^6.26.0:
slash "^1.0.0"
source-map "^0.5.6"

babel-eslint@^8.2.2:
version "8.2.2"
resolved "http://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.2.tgz#1102273354c6f0b29b4ea28a65f97d122296b68b"
babel-eslint@^8.2.3:
version "8.2.3"
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.3.tgz#1a2e6681cc9bc4473c32899e59915e19cd6733cf"
dependencies:
"@babel/code-frame" "^7.0.0-beta.40"
"@babel/traverse" "^7.0.0-beta.40"
"@babel/types" "^7.0.0-beta.40"
babylon "^7.0.0-beta.40"
"@babel/code-frame" "7.0.0-beta.44"
"@babel/traverse" "7.0.0-beta.44"
"@babel/types" "7.0.0-beta.44"
babylon "7.0.0-beta.44"
eslint-scope "~3.7.1"
eslint-visitor-keys "^1.0.0"

Expand Down Expand Up @@ -983,7 +983,7 @@ babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26
lodash "^4.17.4"
to-fast-properties "^1.0.3"

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

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

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

Expand Down Expand Up @@ -1730,17 +1730,16 @@ eslint-module-utils@^2.2.0:
debug "^2.6.8"
pkg-dir "^1.0.0"

eslint-plugin-flowtype@^2.46.1:
version "2.46.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.46.1.tgz#c4f81d580cd89c82bc3a85a1ccf4ae3a915143a4"
eslint-plugin-flowtype@^2.46.2:
version "2.46.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.46.2.tgz#8749fddda6f6c30d0672011151bea726765b5753"
dependencies:
lodash "^4.15.0"

eslint-plugin-import@^2.10.0:
version "2.10.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.10.0.tgz#fa09083d5a75288df9c6c7d09fe12255985655e7"
eslint-plugin-import@^2.11.0:
version "2.11.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.11.0.tgz#15aeea37a67499d848e8e981806d4627b5503816"
dependencies:
builtin-modules "^1.1.1"
contains-path "^0.1.0"
debug "^2.6.8"
doctrine "1.5.0"
Expand All @@ -1750,6 +1749,7 @@ eslint-plugin-import@^2.10.0:
lodash "^4.17.4"
minimatch "^3.0.3"
read-pkg-up "^2.0.0"
resolve "^1.6.0"

eslint-plugin-prettier@^2.6.0:
version "2.6.0"
Expand Down Expand Up @@ -2082,9 +2082,9 @@ flat-cache@^1.2.1:
graceful-fs "^4.1.2"
write "^0.2.1"

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

for-in@^1.0.1, for-in@^1.0.2:
version "1.0.2"
Expand Down Expand Up @@ -2284,11 +2284,12 @@ git-url-parse@^8.0.0:
dependencies:
git-up "^2.0.0"

git-url-parse@^8.1.0:
version "8.2.0"
resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-8.2.0.tgz#74969b0105f805df58873ee5b96bc1a4dc0573b1"
git-url-parse@^9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-9.0.0.tgz#a82a36acc3544c77ed0984d6488b37fbcfbec24d"
dependencies:
git-up "^2.0.0"
parse-domain "^2.0.0"

glob-base@^0.3.0:
version "0.3.0"
Expand Down Expand Up @@ -2364,9 +2365,9 @@ graceful-fs@^4.1.4:
version "4.1.9"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.9.tgz#baacba37d19d11f9d146d3578bc99958c3787e29"

graphql-compose@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/graphql-compose/-/graphql-compose-3.1.1.tgz#97fcf4f4a0aa5d58906eb9ec4166cbf426437c73"
graphql-compose@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/graphql-compose/-/graphql-compose-4.0.0.tgz#6b260dc4e220c33feae46e50e34edd9072ef0244"
dependencies:
babel-runtime "^6.26.0"
object-path "^0.11.4"
Expand Down Expand Up @@ -4016,6 +4017,10 @@ p-retry@^1.0.0:
dependencies:
retry "^0.10.0"

parse-domain@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/parse-domain/-/parse-domain-2.0.0.tgz#e9f42f697c30f7c2051dc5c55ff4d8a80da7943c"

parse-github-url@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/parse-github-url/-/parse-github-url-1.0.2.tgz#242d3b65cbcdda14bb50439e3242acf6971db395"
Expand Down Expand Up @@ -4169,9 +4174,9 @@ preserve@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"

prettier@^1.11.1:
version "1.11.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.11.1.tgz#61e43fc4cd44e68f2b0dfc2c38cd4bb0fccdcc75"
prettier@^1.12.0:
version "1.12.0"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.12.0.tgz#d26fc5894b9230de97629b39cae225b503724ce8"

pretty-format@^22.4.3:
version "22.4.3"
Expand Down Expand Up @@ -4603,6 +4608,12 @@ resolve@^1.2.0:
dependencies:
path-parse "^1.0.5"

resolve@^1.6.0:
version "1.7.1"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.7.1.tgz#aadd656374fd298aee895bc026b8297418677fd3"
dependencies:
path-parse "^1.0.5"

restore-cursor@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
Expand Down Expand Up @@ -4684,9 +4695,9 @@ sax@^1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"

semantic-release@^15.1.4:
version "15.1.4"
resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-15.1.4.tgz#000ddbd8a8977dc1a68cacfbeef2fb551e4b9791"
semantic-release@^15.1.7:
version "15.1.7"
resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-15.1.7.tgz#b29eef1b9443f75addab7c2e353338b72b9b628d"
dependencies:
"@semantic-release/commit-analyzer" "^5.0.0"
"@semantic-release/error" "^2.2.0"
Expand All @@ -4701,7 +4712,7 @@ semantic-release@^15.1.4:
execa "^0.10.0"
get-stream "^3.0.0"
git-log-parser "^1.2.0"
git-url-parse "^8.1.0"
git-url-parse "^9.0.0"
hook-std "^0.4.0"
hosted-git-info "^2.6.0"
lodash "^4.17.4"
Expand Down

0 comments on commit a311f4e

Please sign in to comment.