Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .bithoundrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ignore": [
"**/typings/**",
"**/node_modules/**"
]
}
2 changes: 1 addition & 1 deletion examples/hello-world/api/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ export const resolvers = {
return user;
},
},
}
};
2 changes: 1 addition & 1 deletion examples/hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@angular/platform-browser": "2.0.0-rc.5",
"@angular/platform-browser-dynamic": "2.0.0-rc.5",
"@angular/router": "3.0.0-rc.1",
"angular2-apollo": "^0.4.4",
"angular2-apollo": "^0.4.5",
"apollo-client": "^0.4.14",
"core-js": "^2.4.0",
"rxjs": "5.0.0-beta.11",
Expand Down
9 changes: 6 additions & 3 deletions examples/hello-world/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ export class AppComponent implements OnInit, AfterViewInit {
public nameControl = new FormControl();
// Observable variable of the graphql query
public nameFilter: Subject<string> = new Subject<string>();
private apollo: Angular2Apollo;

// Inject Angular2Apollo service
constructor(private angular2Apollo: Angular2Apollo) {}
constructor(apollo: Angular2Apollo) {
this.apollo = apollo;
}

public ngOnInit() {
// Query users data with observable variables
this.users = this.angular2Apollo.watchQuery({
this.users = this.apollo.watchQuery({
query: gql`
query getUsers($name: String) {
users(name: $name) {
Expand Down Expand Up @@ -61,7 +64,7 @@ export class AppComponent implements OnInit, AfterViewInit {

public newUser(firstName: string) {
// Call the mutation called addUser
this.angular2Apollo.mutate({
this.apollo.mutate({
mutation: gql`
mutation addUser(
$firstName: String!
Expand Down
4 changes: 2 additions & 2 deletions examples/hello-world/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { client } from './client';

@NgModule({
declarations: [
AppComponent
AppComponent,
],
imports: [
BrowserModule,
Expand All @@ -17,6 +17,6 @@ import { client } from './client';
// Define the default ApolloClient
ApolloModule.withClient(client),
],
bootstrap: [AppComponent]
bootstrap: [AppComponent],
})
export class AppModule { }
20 changes: 12 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"test-only": "karma start",
"test-watch": "karma start --no-single-run",
"remap": "remap-istanbul -i coverage/coverage.json -t lcovonly -o coverage/lcov.info",
"lint": "tslint -e src/*.ts && tslint test/*.ts ",
"lint": "tslint -e src/*.ts && tslint tests/*.ts ",
"build": "tsc",
"watch": "tsc -w",
"clean": "rimraf build/* coverage/* typings/*",
Expand All @@ -46,21 +46,25 @@
"@angular/core": "^2.0.0-rc.6",
"@angular/platform-browser": "^2.0.0-rc.6",
"@angular/platform-browser-dynamic": "^2.0.0-rc.6",
"@types/isomorphic-fetch": "0.0.30",
"@types/jasmine": "^2.2.33",
"@types/lodash": "^4.14.34",
"@types/node": "^6.0.38",
"apollo-client": "^0.4.13",
"es6-shim": "^0.35.0",
"ghooks": "^1.2.1",
"graphql": "^0.5.0",
"graphql": "^0.7.0",
"graphql-tag": "^0.1.9",
"istanbul-instrumenter-loader": "^0.2.0",
"jasmine": "^2.4.1",
"jasmine-core": "^2.4.1",
"karma": "^0.13.22",
"karma-chrome-launcher": "^0.2.3",
"karma-coverage": "^0.5.5",
"karma-firefox-launcher": "^0.1.7",
"karma-jasmine": "^0.3.8",
"karma": "^1.0.0",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "^1.1.1",
"karma-firefox-launcher": "^1.0.0",
"karma-jasmine": "^1.0.2",
"karma-webpack": "^1.7.0",
"reflect-metadata": "0.1.2",
"reflect-metadata": "^0.1.8",
"remap-istanbul": "^0.6.3",
"rimraf": "^2.5.2",
"rxjs": "5.0.0-beta.11",
Expand Down
4 changes: 3 additions & 1 deletion tests/Angular2Apollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ describe('angular2Apollo', () => {
const obs = angular2Apollo
.watchQuery(options);

obs.subscribe(() => {});
obs.subscribe(() => {
//
});

obs.refetch({ foo: 'Bar' }).then(result => {
expect(result.data).toEqual(data3);
Expand Down
4 changes: 3 additions & 1 deletion tests/ApolloDecorator/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ describe('Apollo - decorator - queries()', () => {

setTimeout(() => {
let called = false;
component.__apolloHandle.getQuerySub('data').refetch = () => {called = true};
component.__apolloHandle.getQuerySub('data').refetch = () => {
called = true;
};

component.data.refetch(1234);

Expand Down
4 changes: 2 additions & 2 deletions tests/ApolloQueryPipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pipes.forEach(pipe => {
it('should return nothing if name is empty', () => {
expect(pipe.transform({ foo: 'bar' }, '')).toBe(undefined);
});

it('should return nothing if object is empty', () => {
expect(pipe.transform({}, 'foo')).toBe(undefined);
});
Expand All @@ -37,4 +37,4 @@ pipes.forEach(pipe => {
expect(pipe.transform(result, 'foo')).toEqual(result.data.foo);
});
});
})
});
12 changes: 9 additions & 3 deletions tests/_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ import { Document } from 'graphql';
import gql from 'graphql-tag';

export class Lifecycle {
public ngOnInit() {};
public ngDoCheck() {};
public ngOnDestroy() {};
public ngOnInit() {
//
};
public ngDoCheck() {
//
};
public ngOnDestroy() {
//
};
}

export const exampleQuery: Document = gql`
Expand Down
2 changes: 1 addition & 1 deletion tests/_mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function requestToKey(request: ParsedRequest): string {
}

export function mockClient(...args): ApolloClient {
const networkInterface = mockNetworkInterface(...args)
const networkInterface = mockNetworkInterface(...args);

return new ApolloClient({
networkInterface,
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"outDir": "build",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": false
"noImplicitAny": false,
"lib": ["es6", "dom"]
},
"files": [
"typings/index.d.ts",
Expand Down
9 changes: 1 addition & 8 deletions typings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
{
"globalDependencies": {
"es6-shim": "registry:dt/es6-shim#0.31.2+20160602141504",
"isomorphic-fetch": "registry:dt/isomorphic-fetch#0.0.0+20160524142046",
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
"node": "registry:env/node#6.0.0+20160723033700"
},
"dependencies": {
"graphql": "registry:npm/graphql#0.5.0+20160602041655",
"lodash": "registry:npm/lodash#4.0.0+20160701205107"
"graphql": "registry:npm/graphql#0.5.0+20160602041655"
}
}