Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit b2507a2

Browse files
committed
docs(cookbook/graphql): fixes for rollup
1 parent e039395 commit b2507a2

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

public/docs/_examples/heroes-graphql/ts/app/in-memory-graphql.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// #docregion
22
// #docregion import-lodash
3-
import * as _ from 'lodash';
3+
import { find as lodashFind } from 'lodash';
44
// #enddocregion import-lodash
55
// #docregion import-graphql-tools
66
import { makeExecutableSchema } from 'graphql-tools';
@@ -74,12 +74,12 @@ const resolveFunctions = {
7474
}
7575
},
7676
hero(obj: any, args: any, context: any) {
77-
return _.find(heroes, { id: args.heroId });
77+
return lodashFind(heroes, { id: args.heroId });
7878
}
7979
},
8080
Mutation: {
8181
updateHero(root: any, args: any) {
82-
let hero = _.find(heroes, { id: args.id });
82+
let hero = lodashFind(heroes, { id: args.id });
8383
if (!hero) {
8484
throw new Error(`Couldn't find post with id ${args.id}`);
8585
}
@@ -96,7 +96,7 @@ const resolveFunctions = {
9696
return newHero;
9797
},
9898
deleteHero(root: any, args: any) {
99-
let hero = _.find(heroes, { id: args.id });
99+
let hero = lodashFind(heroes, { id: args.id });
100100
if (!hero) {
101101
throw new Error(`Couldn't find post with id ${args.id}`);
102102
}

public/docs/_examples/heroes-graphql/ts/rollup-config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ export default {
3333
namedExports: {
3434
'node_modules/graphql-tools/dist/index.js': ['makeExecutableSchema' ],
3535
'node_modules/graphql/index.js': ['execute' ],
36-
'node_modules/graphql-tag/printer.js': ['print']
36+
'node_modules/graphql-tag/printer.js': ['print'],
37+
'node_modules/lodash/lodash.js': ['find', 'omit', 'assign', 'isFunction'],
3738
}
3839
}),
3940
globals(),

public/docs/_examples/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@
7979
"protractor": "~4.0.14",
8080
"raw-loader": "^0.5.1",
8181
"rimraf": "^2.5.4",
82-
"rollup": "^0.36.0",
83-
"rollup-plugin-commonjs": "^4.1.0",
82+
"rollup": "^0.38.0",
83+
"rollup-plugin-commonjs": "^6.0.1",
8484
"rollup-plugin-node-builtins": "^2.0.0",
8585
"rollup-plugin-node-globals": "^1.1.0",
8686
"rollup-plugin-node-resolve": "^2.0.0",

0 commit comments

Comments
 (0)