Skip to content

Commit

Permalink
Merge pull request #914 from WatWowMap/upgrade-apollo
Browse files Browse the repository at this point in the history
chore: upgrade apollo
  • Loading branch information
TurtIeSocks authored Jan 12, 2024
2 parents 39fdc6a + ff84870 commit 5e606ca
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@
"yarn": "1.22.19"
},
"dependencies": {
"@apollo/client": "^3.8.7",
"@apollo/server": "^4.9.5",
"@apollo/client": "^3.8.9",
"@apollo/server": "^4.10.0",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@graphql-tools/graphql-file-loader": "^8.0.0",
Expand Down
8 changes: 5 additions & 3 deletions src/components/QueryData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,13 @@ function QueryData({ category, timeout }) {
if (active) {
timeout.current.setupTimeout(refetch)
return () => {
useMemory.setState({ excludeList: [] })
useMemory.setState((prev) => ({
excludeList: prev.excludeList.length ? [] : prev.excludeList,
}))
timeout.current.off()
}
}
}, [active, refetch, timeout])
}, [active, refetch, timeout.current])

React.useEffect(() => {
const refetchData = () => {
Expand All @@ -161,7 +163,7 @@ function QueryData({ category, timeout }) {
return () => {
map.off('fetchdata', refetchData)
}
}, [filters, userSettings, onlyAreas])
}, [filters, userSettings, onlyAreas, timeout.current.refetch])

if (error) {
// @ts-ignore
Expand Down
2 changes: 2 additions & 0 deletions src/services/apollo/RobustTimeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,7 @@ export default class RobustTimeout extends AbortableContext {

off() {
clearTimeout(this.timeout)
this.refetch = null
delete this._pendingVariables
}
}
31 changes: 24 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
resolved "https://registry.yarnpkg.com/@apollo/cache-control-types/-/cache-control-types-1.0.3.tgz#5da62cf64c3b4419dabfef4536b57a40c8ff0b47"
integrity sha512-F17/vCp7QVwom9eG7ToauIKdAxpSoadsJnqIfyryLFSkLSOEqu+eC5Z3N8OXcUVStuOMcNHlyraRsA6rRICu4g==

"@apollo/client@^3.7.15", "@apollo/client@^3.8.7":
"@apollo/client@^3.7.15":
version "3.8.8"
resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.8.8.tgz#1a004b2e6de4af38668249a7d7790f6a3431e475"
integrity sha512-omjd9ryGDkadZrKW6l5ktUAdS4SNaFOccYQ4ZST0HLW83y8kQaSZOCTNlpkoBUK8cv6qP8+AxOKwLm2ho8qQ+Q==
Expand All @@ -38,6 +38,24 @@
tslib "^2.3.0"
zen-observable-ts "^1.2.5"

"@apollo/client@^3.8.9":
version "3.8.9"
resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.8.9.tgz#0e4ac133eb04c63e618138c1ebf273d9f110a4d0"
integrity sha512-IcQDFEEPc9+PEQsxhxQvsoQ04BRarOzi/Ila5PcniRSDeKJWgY22dnp6+V1i1fWXRDVd1ybdvze4sFESDVQUCQ==
dependencies:
"@graphql-typed-document-node/core" "^3.1.1"
"@wry/equality" "^0.5.6"
"@wry/trie" "^0.5.0"
graphql-tag "^2.12.6"
hoist-non-react-statics "^3.3.2"
optimism "^0.18.0"
prop-types "^15.7.2"
response-iterator "^0.2.6"
symbol-observable "^4.0.0"
ts-invariant "^0.10.3"
tslib "^2.3.0"
zen-observable-ts "^1.2.5"

"@apollo/[email protected]":
version "1.2.7"
resolved "https://registry.yarnpkg.com/@apollo/protobufjs/-/protobufjs-1.2.7.tgz#3a8675512817e4a046a897e5f4f16415f16a7d8a"
Expand Down Expand Up @@ -66,10 +84,10 @@
"@apollo/utils.keyvaluecache" "^2.1.0"
"@apollo/utils.logger" "^2.0.0"

"@apollo/server@^4.9.5":
version "4.9.5"
resolved "https://registry.yarnpkg.com/@apollo/server/-/server-4.9.5.tgz#388b3e00bef370fbdb89dd22d5a56127afaf87ba"
integrity sha512-eDBfArYbZaTm1AGa82M1aL7lOscVhnZsH85+OWmHMIR98qntzEjNpWpQPYDTru63Qxs4kHcY29NUx/kMGZfGEA==
"@apollo/server@^4.10.0":
version "4.10.0"
resolved "https://registry.yarnpkg.com/@apollo/server/-/server-4.10.0.tgz#fd3c003149b0774903c15a0cfef38e20d05aa096"
integrity sha512-pLx//lZ/pvUfWL9G8Np8+y3ujc0pYc8U7dwD6ztt9FAw8NmCPzPaDzlXLBAjGU6WnkqVBOnz8b3dOwRNjLYSUA==
dependencies:
"@apollo/cache-control-types" "^1.0.3"
"@apollo/server-gateway-interface" "^1.1.1"
Expand All @@ -87,7 +105,6 @@
"@types/express-serve-static-core" "^4.17.30"
"@types/node-fetch" "^2.6.1"
async-retry "^1.2.1"
body-parser "^1.20.0"
cors "^2.8.5"
express "^4.17.1"
loglevel "^1.6.8"
Expand Down Expand Up @@ -2861,7 +2878,7 @@ [email protected]:
type-is "~1.6.18"
unpipe "1.0.0"

body-parser@^1.20.0, body-parser@^1.20.2:
body-parser@^1.20.2:
version "1.20.2"
resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd"
integrity sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==
Expand Down

0 comments on commit 5e606ca

Please sign in to comment.