Skip to content

Commit

Permalink
fix(deps): update apollo graphql packages to v2 (major) (#2054)
Browse files Browse the repository at this point in the history
* fix(deps): update apollo graphql packages to v2

* Skip tests on v15

* disable tests altogether for gql less than 15

* update subgraph

* rename only if exists

Co-authored-by: enisdenjo <badurinadenis@gmail.com>
Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
  • Loading branch information
3 people committed Nov 11, 2022
1 parent 8c89927 commit 48f7cd7
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 44 deletions.
2 changes: 1 addition & 1 deletion examples/apollo-federation/gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"check": "exit 0"
},
"dependencies": {
"@apollo/gateway": "^0.52.0",
"@apollo/gateway": "^2.0.0",
"@envelop/apollo-federation": "3.0.3",
"graphql-yoga": "3.0.0-next.12",
"graphql": "^16.5.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/apollo-federation/service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"check": "exit 0"
},
"dependencies": {
"@apollo/subgraph": "^0.5.0",
"@apollo/subgraph": "^2.0.0",
"graphql-yoga": "3.0.0-next.12",
"graphql": "^16.2.0"
}
Expand Down
105 changes: 63 additions & 42 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions scripts/override-graphql-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,42 @@ pkg.resolutions = {
}

fs.writeFileSync(pkgPath, JSON.stringify(pkg, undefined, ' ') + '\n')

// disable apollo federation testing with <16 versions
const graphql15AndLess = parseInt(graphqlVersion.split('.')[0]) <= 15
;[`examples/apollo-federation`].forEach((testPath) => {
if (graphql15AndLess) {
// disable
const testPathAbs = path.resolve(
__dirname,
'..',
testPath,
'__integration-tests__',
)
if (fs.existsSync(testPathAbs)) {
fs.renameSync(
testPathAbs,
path.resolve(
__dirname,
'..',
testPath,
'__DISABLED_integration-tests__',
),
)
}
} else {
// enable if disabled
const testPathAbs = path.resolve(
__dirname,
'..',
testPath,
'__DISABLED_integration-tests__',
)
if (fs.existsSync(testPathAbs)) {
fs.renameSync(
testPathAbs,
path.resolve(__dirname, '..', testPath, '__integration-tests__'),
)
}
}
})

0 comments on commit 48f7cd7

Please sign in to comment.