Skip to content

Commit 169817f

Browse files
committed
feat: use apollo-upload-client instead of http link
1 parent 7e8c9b1 commit 169817f

File tree

5 files changed

+24
-12
lines changed

5 files changed

+24
-12
lines changed

packages/smooth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
"apollo-cache-inmemory": "^1.5.1",
4949
"apollo-client": "^2.5.1",
5050
"apollo-link": "^1.2.11",
51-
"apollo-link-http": "^1.5.14",
5251
"apollo-link-schema": "^1.2.2",
5352
"apollo-server-express": "^2.5.0",
53+
"apollo-upload-client": "^10.0.1",
5454
"axios": "^0.18.0",
5555
"babel-loader": "^8.0.6",
5656
"camelcase": "^5.3.1",

packages/smooth/src/client/apollo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ApolloClient } from 'apollo-client'
2-
import { HttpLink } from 'apollo-link-http'
2+
import { createUploadLink } from 'apollo-upload-client'
33
import {
44
InMemoryCache,
55
IntrospectionFragmentMatcher,
@@ -8,7 +8,7 @@ import fragmentTypes from '__smooth_fragmentTypes'
88

99
export function createApolloClient() {
1010
return new ApolloClient({
11-
link: new HttpLink({
11+
link: createUploadLink({
1212
uri: '/graphql',
1313
credentials: 'same-origin',
1414
}),
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import gql from 'graphql-tag'
2+
3+
export const typeDefs = gql`
4+
scalar Upload
5+
`

packages/smooth/src/graphql/definitions/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ import * as Metadata from './Metadata'
77
import * as Mutation from './Mutation'
88
import * as Query from './Query'
99
import * as schema from './schema'
10+
import * as Upload from './Upload'
1011

1112
export const definitions = [
1213
Date,
14+
Upload,
1315
directives,
1416
Media,
1517
Image,

yarn.lock

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2553,15 +2553,6 @@ apollo-link-http-common@^0.2.13:
25532553
ts-invariant "^0.3.2"
25542554
tslib "^1.9.3"
25552555

2556-
apollo-link-http@^1.5.14:
2557-
version "1.5.14"
2558-
resolved "https://registry.yarnpkg.com/apollo-link-http/-/apollo-link-http-1.5.14.tgz#ed6292248d1819ccd16523e346d35203a1b31109"
2559-
integrity sha512-XEoPXmGpxFG3wioovgAlPXIarWaW4oWzt8YzjTYZ87R4R7d1A3wKR/KcvkdMV1m5G7YSAHcNkDLe/8hF2nH6cg==
2560-
dependencies:
2561-
apollo-link "^1.2.11"
2562-
apollo-link-http-common "^0.2.13"
2563-
tslib "^1.9.3"
2564-
25652556
apollo-link-schema@^1.2.2:
25662557
version "1.2.2"
25672558
resolved "https://registry.yarnpkg.com/apollo-link-schema/-/apollo-link-schema-1.2.2.tgz#9938340c8044f6f5de4c6957f2dab75ed361b35a"
@@ -2665,6 +2656,15 @@ apollo-tracing@0.6.0:
26652656
apollo-server-env "2.3.0"
26662657
graphql-extensions "0.6.0"
26672658

2659+
apollo-upload-client@^10.0.1:
2660+
version "10.0.1"
2661+
resolved "https://registry.yarnpkg.com/apollo-upload-client/-/apollo-upload-client-10.0.1.tgz#e8446288d03edb1c582c91c26a18b27533f85013"
2662+
integrity sha512-K6WnuYQi0RRTNO+aSPVjoUWXp4QSr+eoKU4fE0OKQp25XRF2oXl2cTLs+Q4Nk0wOIHM76YGdo/IHtzuNR7jO+A==
2663+
dependencies:
2664+
apollo-link "^1.2.11"
2665+
apollo-link-http-common "^0.2.13"
2666+
extract-files "^5.0.1"
2667+
26682668
apollo-utilities@1.2.1, apollo-utilities@^1.2.1:
26692669
version "1.2.1"
26702670
resolved "https://registry.yarnpkg.com/apollo-utilities/-/apollo-utilities-1.2.1.tgz#1c3a1ebf5607d7c8efe7636daaf58e7463b41b3c"
@@ -5133,6 +5133,11 @@ extglob@^2.0.4:
51335133
snapdragon "^0.8.1"
51345134
to-regex "^3.0.1"
51355135

5136+
extract-files@^5.0.1:
5137+
version "5.0.1"
5138+
resolved "https://registry.yarnpkg.com/extract-files/-/extract-files-5.0.1.tgz#c9492a8410be643e260a376f0151361993d5f659"
5139+
integrity sha512-qRW6y9eKF0VbCyOoOEtFhzJ3uykAw8GKwQVXyAIqwocyEWW4m+v+evec34RwtUkkxxHh7NKBLJ6AnXM8W4dH5w==
5140+
51365141
extsprintf@1.3.0:
51375142
version "1.3.0"
51385143
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"

0 commit comments

Comments
 (0)