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

Commit 4e4ec12

Browse files
committed
docs(cookbook/graphql): Fixes for AOT
1 parent 3669f26 commit 4e4ec12

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

public/docs/_examples/heroes-graphql/e2e-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Hero {
4343
}
4444
}
4545

46-
describe('Tutorial part 6', () => {
46+
describe('Heroes GraphQL', () => {
4747

4848
beforeAll(() => browser.get(''));
4949

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
// #docregion
2-
import ApolloClient, { createNetworkInterface } from 'apollo-client';
2+
import { ApolloClient, createNetworkInterface } from 'apollo-client';
33
import { networkInterface } from './in-memory-graphql';
44

5-
export const client = new ApolloClient({
5+
const client = new ApolloClient({
66
networkInterface,
77
dataIdFromObject: (object:any) => object.id,
88
});
9+
export {
10+
client
11+
}
912
// #enddocregion

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const resolveFunctions = {
6767
heroes(obj: any, args: any) {
6868
if (args.search) {
6969
return heroes.filter(function (currentHero) {
70-
return currentHero.name.search(args.search) != -1;
70+
return currentHero.name.toLowerCase().search(args.search.toLowerCase()) != -1;
7171
});
7272
} else {
7373
return heroes;
@@ -133,6 +133,9 @@ class InBrowserNetworkInterface {
133133
}
134134
}
135135

136-
export const networkInterface = new InBrowserNetworkInterface({ schema });
136+
const networkInterface = new InBrowserNetworkInterface({ schema });
137+
export {
138+
networkInterface
139+
}
137140
// #enddocregion execute-and-export
138141
// #enddocregion

0 commit comments

Comments
 (0)