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
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ install:
- npm i
- npm install -g typings
- npm install -g coveralls
# temporary fix
- (cd node_modules/apollo-client && npm run compile)

script:
# remove unused node modules from cache
Expand Down
3 changes: 2 additions & 1 deletion examples/hello-world/client/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ <h2>Add new</h2>
<input type="submit" value="Add user" (click)="newUser(firstName)" />

<h2>List</h2>

<ul>
<li *ngFor="#user of users | async | apolloQuery:'users'">
<li *ngFor="let user of users | async | apolloQuery:'users'">
{{ user.firstName }} {{ user.lastName }}
</li>
</ul>
10 changes: 6 additions & 4 deletions examples/hello-world/client/main.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
bootstrap,
} from "angular2/platform/browser";
} from "@angular/platform-browser-dynamic";

import {
Component,
Injectable,
} from "angular2/core";
} from "@angular/core";

import {
Observable,
Expand All @@ -20,6 +20,8 @@ import ApolloClient, {
createNetworkInterface,
} from 'apollo-client';

import gql from 'apollo-client/gql';

import {
graphQLResult
} from 'graphql';
Expand All @@ -39,7 +41,7 @@ const client = new ApolloClient({
queries(state: any) {
return {
users: {
query: `
query: gql`
query getUsers($name: String) {
users(name: $name) {
firstName
Expand All @@ -60,7 +62,7 @@ const client = new ApolloClient({
mutations(state: any) {
return {
addUser: (firstName: string) => ({
mutation: `
mutation: gql`
mutation addUser(
$firstName: String!
$lastName: String!
Expand Down
11 changes: 8 additions & 3 deletions examples/hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@
"start": "meteor run"
},
"dependencies": {
"angular2": "^2.0.0-beta.15",
"@angular/core": "2.0.0-rc.1",
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"angular2-apollo": "file:../../",
"apollo-client": "0.1.2",
"apollo-client": "0.3.12",
"casual-browserify": "^1.5.2",
"express": "^4.13.4",
"fs.extra": "^1.3.2",
"graphql": "^0.5.0",
"graphql-tools": "^0.3.8",
"http-proxy-middleware": "^0.14.0",
"meteor-node-stubs": "~0.2.0"
"meteor-node-stubs": "~0.2.0",
"rxjs": "^5.0.0-beta.6"
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"lint": "tslint -e src/*.ts && tslint test/*.ts ",
"build": "tsc",
"watch": "tsc -w",
"clear": "rimraf build/* coverage/*"
"clear": "rimraf build/* coverage/*",
"prepublish": "npm run build"
},
"repository": {
"type": "git",
Expand All @@ -36,7 +37,7 @@
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"apollo-client": "0.1.2",
"apollo-client": "^0.3.0",
"es6-shim": "0.35.0",
"graphql": "^0.5.0",
"lodash": "^4.11.1",
Expand Down
8 changes: 4 additions & 4 deletions src/apolloQueryPipe.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/// <reference path="../typings/main.d.ts" />

import {Pipe} from '@angular/core';
import {
Pipe,
} from '@angular/core';

@Pipe({
name: 'apolloQuery',
})
export class ApolloQueryPipe {
public transform(obj, args) {
const name = args[0] || '';

public transform(obj: any, name: string = '') {
if (obj && obj.data && name !== '' && obj.data[name]) {
return obj.data[name];
}
Expand Down
2 changes: 1 addition & 1 deletion tests/apolloQueryPipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('ApolloQueryPipe', () => {
foo: 'bar',
},
};
const result = pipe.transform(object, ['foo']);
const result = pipe.transform(object, 'foo');

expect(result).toEqual(object.data.foo);
});
Expand Down
2 changes: 1 addition & 1 deletion typings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"jasmine": "registry:dt/jasmine#2.2.0+20160412134438"
},
"dependencies": {
"apollo-client": "file:node_modules/apollo-client/lib/src/index.d.ts",
"apollo-client": "file:node_modules/apollo-client/index.d.ts",
"lodash": "registry:npm/lodash#4.0.0+20160416211519"
}
}
Loading