Skip to content

Commit

Permalink
Fabo/retry on failed requests (#3382)
Browse files Browse the repository at this point in the history
* retry on failed requests

* changelog
  • Loading branch information
faboweb authored and jbibla committed Jan 8, 2020
1 parent 9481b3e commit 35f7d6f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions changes/fabo_retry-on-failed-requests
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[Added] Retry graphql fetches on failed attempts @faboweb
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"apollo-cache-inmemory": "^1.6.2",
"apollo-link-batch-http": "1.2.13",
"apollo-link-persisted-queries": "0.2.2",
"apollo-link-retry": "2.2.15",
"apollo-link-ws": "1.0.19",
"apollo-utilities": "1.3.2",
"autosize": "^4.0.2",
Expand Down
4 changes: 3 additions & 1 deletion src/gql/apollo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Vue from "vue"
import { ApolloClient } from "apollo-boost"
import { BatchHttpLink } from "apollo-link-batch-http"
import { RetryLink } from "apollo-link-retry"
import { createPersistedQueryLink } from "apollo-link-persisted-queries"
import { WebSocketLink } from "apollo-link-ws"
import { InMemoryCache } from "apollo-cache-inmemory"
Expand All @@ -25,7 +26,8 @@ const makeHttpLink = urlParams => {
return createPersistedQueryLink().concat(
new BatchHttpLink({
uri
})
}),
new RetryLink()
)
}

Expand Down
11 changes: 10 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@
"@types/unist" "*"
"@types/vfile-message" "*"

"@types/zen-observable@^0.8.0":
"@types/zen-observable@0.8.0", "@types/zen-observable@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.0.tgz#8b63ab7f1aa5321248aad5ac890a485656dcea4d"
integrity sha512-te5lMAWii1uEJ4FwLjzdlbw3+n0FZNOvFXHxQDKeT0dilh7HOzdMzV2TrJVUzq8ep7J4Na8OUYPRLSQkJHAlrg==
Expand Down Expand Up @@ -1783,6 +1783,15 @@ apollo-link-persisted-queries@0.2.2:
apollo-link "^1.2.1"
hash.js "^1.1.3"

apollo-link-retry@2.2.15:
version "2.2.15"
resolved "https://registry.yarnpkg.com/apollo-link-retry/-/apollo-link-retry-2.2.15.tgz#4cc3202fcb6251fed6f6b57ade99b4b1ad05c619"
integrity sha512-ltwXGxm+2NXzskrk+GTofj66LQtcc9OGCjIxAPbjlvtHanpKJn8CviWq8dIsMiYGS9T9rGG/kPPx/VdJfcFb6w==
dependencies:
"@types/zen-observable" "0.8.0"
apollo-link "^1.2.13"
tslib "^1.9.3"

apollo-link-ws@1.0.19:
version "1.0.19"
resolved "https://registry.yarnpkg.com/apollo-link-ws/-/apollo-link-ws-1.0.19.tgz#dfa871d4df883a8777c9556c872fc892e103daa5"
Expand Down

0 comments on commit 35f7d6f

Please sign in to comment.