Skip to content

Commit c6c663f

Browse files
authored
Merge pull request #133 from marmelab/revert-127-upgrade-deps
Revert "Upgrade dependencies"
2 parents 9c04eab + b410149 commit c6c663f

File tree

6 files changed

+1493
-815
lines changed

6 files changed

+1493
-815
lines changed

package.json

+10-8
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@types/jest": "^25.2.1",
3939
"babel-eslint": "^10.0.3",
4040
"babel-jest": "^25.4.0",
41-
"babel-loader": "^8.2.2",
41+
"babel-loader": "^8.0.6",
4242
"babel-plugin-add-module-exports": "^1.0.2",
4343
"eslint": "^6.5.1",
4444
"eslint-config-prettier": "^6.4.0",
@@ -50,17 +50,19 @@
5050
"lint-staged": "^10.1.7",
5151
"prettier": "^2.0.5",
5252
"supertest": "^4.0.2",
53-
"webpack": "^5.53.0",
54-
"webpack-cli": "^4.8.0"
53+
"webpack": "^4.41.0",
54+
"webpack-cli": "^3.3.9"
5555
},
5656
"dependencies": {
57-
"@apollo/client": "^3.4.13",
58-
"@graphql-tools/schema": "^8.2.0",
57+
"apollo-client": "^2.6.4",
58+
"apollo-test-utils": "^0.3.2",
5959
"cors": "^2.8.4",
6060
"express": "^4.17.1",
61-
"express-graphql": "^0.12.0",
62-
"graphql": "^15.6.0",
63-
"graphql-type-json": "^0.3.2",
61+
"express-graphql": "^0.9.0",
62+
"graphql": "^14.5.8",
63+
"graphql-tag": "^2.10.1",
64+
"graphql-tools": "^4.0.5",
65+
"graphql-type-json": "^0.3.0",
6466
"inflection": "^1.12.0",
6567
"lodash.merge": "^4.6.2",
6668
"reify": "^0.20.12",

src/createApolloClient.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { ApolloClient } from 'apollo-client';
2+
import { mockNetworkInterfaceWithSchema } from 'apollo-test-utils';
3+
import getSchemaFromData from './introspection/getSchemaFromData';
4+
5+
export default (data) => {
6+
const schema = getSchemaFromData(data);
7+
const mockNetworkInterface = mockNetworkInterfaceWithSchema({ schema });
8+
9+
const client = new ApolloClient({
10+
networkInterface: mockNetworkInterface,
11+
});
12+
13+
return client;
14+
};

src/introspection/getSchemaFromData.spec.js

+14-56
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,8 @@ test('creates three query fields per data type', () => {
129129
expect(queries['Post'].type.name).toEqual(PostType.name);
130130
expect(queries['Post'].args).toEqual([
131131
{
132-
astNode: undefined,
133132
defaultValue: undefined,
134-
description: undefined,
135-
deprecationReason: undefined,
136-
extensions: undefined,
133+
description: null,
137134
name: 'id',
138135
type: new GraphQLNonNull(GraphQLID),
139136
},
@@ -154,11 +151,8 @@ test('creates three query fields per data type', () => {
154151
expect(queries['User'].type.name).toEqual(UserType.name);
155152
expect(queries['User'].args).toEqual([
156153
{
157-
astNode: undefined,
158154
defaultValue: undefined,
159-
description: undefined,
160-
deprecationReason: undefined,
161-
extensions: undefined,
155+
description: null,
162156
name: 'id',
163157
type: new GraphQLNonNull(GraphQLID),
164158
},
@@ -184,123 +178,87 @@ test('creates three mutation fields per data type', () => {
184178
{
185179
name: 'title',
186180
type: new GraphQLNonNull(GraphQLString),
187-
astNode: undefined,
188181
defaultValue: undefined,
189-
description: undefined,
190-
deprecationReason: undefined,
191-
extensions: undefined,
182+
description: null,
192183
},
193184
{
194185
name: 'views',
195186
type: new GraphQLNonNull(GraphQLInt),
196-
astNode: undefined,
197187
defaultValue: undefined,
198-
description: undefined,
199-
deprecationReason: undefined,
200-
extensions: undefined,
188+
description: null,
201189
},
202190
{
203191
name: 'user_id',
204192
type: new GraphQLNonNull(GraphQLID),
205-
astNode: undefined,
206193
defaultValue: undefined,
207-
description: undefined,
208-
deprecationReason: undefined,
209-
extensions: undefined,
194+
description: null,
210195
},
211196
]);
212197
expect(mutations['updatePost'].type.name).toEqual(PostType.name);
213198
expect(mutations['updatePost'].args).toEqual([
214199
{
215200
name: 'id',
216201
type: new GraphQLNonNull(GraphQLID),
217-
astNode: undefined,
218202
defaultValue: undefined,
219-
description: undefined,
220-
deprecationReason: undefined,
221-
extensions: undefined,
203+
description: null,
222204
},
223205
{
224206
name: 'title',
225207
type: GraphQLString,
226-
astNode: undefined,
227208
defaultValue: undefined,
228-
description: undefined,
229-
deprecationReason: undefined,
230-
extensions: undefined,
209+
description: null,
231210
},
232211
{
233212
name: 'views',
234213
type: GraphQLInt,
235-
astNode: undefined,
236214
defaultValue: undefined,
237-
description: undefined,
238-
deprecationReason: undefined,
239-
extensions: undefined,
215+
description: null,
240216
},
241217
{
242218
name: 'user_id',
243219
type: GraphQLID,
244-
astNode: undefined,
245220
defaultValue: undefined,
246-
description: undefined,
247-
deprecationReason: undefined,
248-
extensions: undefined,
221+
description: null,
249222
},
250223
]);
251224
expect(mutations['removePost'].type.name).toEqual(PostType.name);
252225
expect(mutations['removePost'].args).toEqual([
253226
{
254227
name: 'id',
255228
type: new GraphQLNonNull(GraphQLID),
256-
astNode: undefined,
257229
defaultValue: undefined,
258-
description: undefined,
259-
deprecationReason: undefined,
260-
extensions: undefined,
230+
description: null,
261231
},
262232
]);
263233
expect(mutations['createUser'].type.name).toEqual(UserType.name);
264234
expect(mutations['createUser'].args).toEqual([
265235
{
266236
name: 'name',
267237
type: new GraphQLNonNull(GraphQLString),
268-
astNode: undefined,
269238
defaultValue: undefined,
270-
description: undefined,
271-
deprecationReason: undefined,
272-
extensions: undefined,
239+
description: null,
273240
},
274241
]);
275242
expect(mutations['updateUser'].type.name).toEqual(UserType.name);
276243
expect(mutations['updateUser'].args).toEqual([
277244
{
278245
name: 'id',
279246
type: new GraphQLNonNull(GraphQLID),
280-
astNode: undefined,
281247
defaultValue: undefined,
282-
description: undefined,
283-
deprecationReason: undefined,
284-
extensions: undefined,
248+
description: null,
285249
},
286250
{
287251
name: 'name',
288252
type: GraphQLString,
289-
astNode: undefined,
290253
defaultValue: undefined,
291-
description: undefined,
292-
deprecationReason: undefined,
293-
extensions: undefined,
254+
description: null,
294255
},
295256
]);
296257
expect(mutations['removeUser'].type.name).toEqual(UserType.name);
297258
expect(mutations['removeUser'].args).toEqual([
298259
{
299-
astNode: undefined,
300260
defaultValue: undefined,
301-
description: undefined,
302-
deprecationReason: undefined,
303-
extensions: undefined,
261+
description: null,
304262
name: 'id',
305263
type: new GraphQLNonNull(GraphQLID),
306264
},

src/schemaBuilder.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { makeExecutableSchema } from '@graphql-tools/schema';
1+
import { makeExecutableSchema } from 'graphql-tools';
22
import { printSchema } from 'graphql';
33
import getSchemaFromData from './introspection/getSchemaFromData';
44
import resolver from './resolver';

webpack.config.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ let plugins = [];
66
let outputFile;
77

88
if (process.env.NODE_ENV === 'production') {
9-
outputFile = (target) => `${libraryName}.${target}.min.js`;
9+
outputFile = target => `${libraryName}.${target}.min.js`;
1010
} else {
11-
outputFile = (target) => `${libraryName}.${target}.js`;
11+
outputFile = target => `${libraryName}.${target}.js`;
1212
}
1313

1414
const defaultConfig = {
@@ -21,11 +21,6 @@ const defaultConfig = {
2121
loader: 'babel-loader',
2222
exclude: /(node_modules|bower_components)/,
2323
},
24-
{
25-
include: /node_modules/,
26-
test: /\.mjs$/,
27-
type: 'javascript/auto',
28-
},
2924
],
3025
},
3126
resolve: {

0 commit comments

Comments
 (0)