Skip to content

Commit

Permalink
Merge branch 'master' into bug/apollographqlGH-3030/no-cache-undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
kamranayub authored Mar 6, 2018
2 parents 69430b0 + cb7bc2b commit 0fd8663
Show file tree
Hide file tree
Showing 13 changed files with 115 additions and 75 deletions.
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,15 @@ Instructions for how the issue can be reproduced by a maintainer or contributor.

**Version**
- apollo-client@<version number>

<!--**Issue Labels**
While not necessary, you can help organize our issues by labeling this issue when you open it. To add a label automatically, simply [x] mark the appropriate box below:
- [ ] has-reproduction
- [ ] feature
- [ ] blocking
- [ ] good first issue
To add a label not listed above, simply place `/label another-label-name` on a line by itself.
-->
12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,15 @@
- [ ] If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
- [ ] Make sure all of the significant new logic is covered by tests
- [ ] If this was a change that affects the external API used in GitHunt-React, update GitHunt-React and post a link to the PR in the discussion.

<!--**Pull Request Labels**
While not necessary, you can help organize our pull requests by labeling this issue when you open it. To add a label automatically, simply [x] mark the appropriate box below:
- [ ] has-reproduction
- [ ] feature
- [ ] blocking
- [ ] good first review
To add a label not listed above, simply place `/label another-label-name` on a line by itself.
-->
1 change: 0 additions & 1 deletion docs/source/features/optimistic-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ Here is a concrete example from GitHunt, which inserts a comment into an existin
import React from 'react';
import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
import update from 'immutability-helper';

import CommentAppQuery from '../queries/CommentAppQuery';

Expand Down
2 changes: 1 addition & 1 deletion docs/source/features/subscriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ and start the actual subscription by calling the `subscribeToNewComments` functi

```js
export class CommentsPage extends Component {
componentWillMount() {
componentDidMount() {
this.props.subscribeToNewComments({
repoFullName: this.props.repoFullName,
});
Expand Down
5 changes: 2 additions & 3 deletions docs/source/recipes/pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Offset-based pagination — also called numbered pages — is a very common patt
Here is an example with numbered pages taken from [GitHunt](https://github.com/apollographql/GitHunt-React):

```js

const FEED_QUERY = gql`
query Feed($type: FeedType!, $offset: Int, $limit: Int) {
currentUser {
Expand Down Expand Up @@ -65,10 +64,10 @@ const FeedWithData = graphql(FEED_QUERY, {
offset: feed.length,
},
updateQuery: (previousResult, { fetchMoreResult }) => {
if (!fetchMoreResult) { return previousResult; }
if (!fetchMoreResult.data) { return previousResult; }
return Object.assign({}, previousResult, {
// Append the new feed results to the old one
feed: [...previousResult.feed, ...fetchMoreResult.feed],
feed: [...previousResult.feed, ...fetchMoreResult.data.feed],
});
},
});
Expand Down
1 change: 1 addition & 0 deletions packages/apollo-boost/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### vNext
- Map coverage to original source
- fix request parameter type [#3056](https://github.com/apollographql/apollo-client/pull/3056)

### 0.1.0
- DEPRECATED: `apollo-client-preset`
Expand Down
21 changes: 12 additions & 9 deletions packages/apollo-boost/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-boost",
"version": "0.1.1",
"version": "0.1.2",
"description": "The easiest way to get started with Apollo Client",
"author": "Peggy Rayzis <[email protected]>",
"contributors": [
Expand Down Expand Up @@ -28,15 +28,13 @@
"watch": "tsc -w -p .",
"clean": "rimraf coverage/* && rimraf lib/*",
"prepublishOnly": "npm run build",
"build:browser":
"browserify ./lib/index.js --i apollo-utilities -o=./lib/bundle.js && npm run minify:browser",
"minify:browser":
"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js",
"build:browser": "browserify ./lib/index.js --i apollo-utilities -o=./lib/bundle.js && npm run minify:browser",
"minify:browser": "uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js",
"filesize": "npm run build && npm run build:browser"
},
"dependencies": {
"apollo-cache-inmemory": "^1.1.9",
"apollo-client": "^2.2.5",
"apollo-cache-inmemory": "^1.1.10",
"apollo-client": "^2.2.6",
"apollo-link": "^1.0.6",
"apollo-link-error": "^1.0.3",
"apollo-link-http": "^1.3.1",
Expand All @@ -46,7 +44,7 @@
"devDependencies": {
"@types/graphql": "0.12.4",
"@types/jest": "21.1.10",
"apollo-cache": "^1.1.4",
"apollo-cache": "^1.1.5",
"browserify": "15.2.0",
"graphql": "0.13.1",
"jest": "20.0.4",
Expand All @@ -62,7 +60,12 @@
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
"moduleFileExtensions": ["ts", "tsx", "js", "json"],
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"json"
],
"mapCoverage": true
}
}
14 changes: 6 additions & 8 deletions packages/apollo-boost/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,11 @@ export default class DefaultClient<TCache> extends ApolloClient<TCache> {

const requestHandler =
config && config.request
? new ApolloLink((operation, forward) => {
const { ...request } = operation;

return new Observable(observer => {
? new ApolloLink((operation, forward) =>
new Observable(observer => {
let handle: any;
Promise.resolve(request)
.then(req => config.request(req))
Promise.resolve(operation)
.then(oper => config.request(oper))
.then(() => {
handle = forward(operation).subscribe({
next: observer.next.bind(observer),
Expand All @@ -69,8 +67,8 @@ export default class DefaultClient<TCache> extends ApolloClient<TCache> {
return () => {
if (handle) handle.unsubscribe;
};
});
})
})
)
: false;

const httpLink = new HttpLink({
Expand Down
23 changes: 13 additions & 10 deletions packages/apollo-cache-inmemory/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-cache-inmemory",
"version": "1.1.9",
"version": "1.1.10",
"description": "Core abstract of Caching layer for Apollo Client",
"author": "James Baxley <[email protected]>",
"contributors": [
Expand Down Expand Up @@ -33,16 +33,14 @@
"watch": "tsc -w -p .",
"clean": "rimraf coverage/* && rimraf lib/*",
"prepublishOnly": "npm run build",
"build:browser":
"browserify ./lib/bundle.umd.js --i apollo-cache --i apollo-utilities --i graphql -o=./lib/bundle.js && npm run minify:browser",
"minify:browser":
"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js",
"build:browser": "browserify ./lib/bundle.umd.js --i apollo-cache --i apollo-utilities --i graphql -o=./lib/bundle.js && npm run minify:browser",
"minify:browser": "uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js",
"filesize": "npm run build:browser"
},
"dependencies": {
"apollo-cache": "^1.1.4",
"apollo-utilities": "^1.0.8",
"graphql-anywhere": "^4.1.5"
"apollo-cache": "^1.1.5",
"apollo-utilities": "^1.0.9",
"graphql-anywhere": "^4.1.6"
},
"peerDependencies": {
"graphql": "0.11.7 || ^0.12.0 || ^0.13.0"
Expand All @@ -57,7 +55,7 @@
"jest": "20.0.4",
"lodash": "4.17.5",
"rimraf": "2.6.2",
"rollup": "0.56.0",
"rollup": "0.56.4",
"ts-jest": "20.0.14",
"tslint": "5.9.1",
"typescript": "2.5.2",
Expand All @@ -68,7 +66,12 @@
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
"moduleFileExtensions": ["ts", "tsx", "js", "json"],
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"json"
],
"mapCoverage": true
}
}
22 changes: 12 additions & 10 deletions packages/apollo-cache/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apollo-cache",
"version": "1.1.4",
"version": "1.1.5",
"description": "Core abstract of Caching layer for Apollo Client",
"author": "James Baxley <[email protected]>",
"contributors": [
Expand All @@ -25,23 +25,20 @@
"scripts": {
"coverage": "jest --coverage",
"test": "jest",
"lint":
"tslint --type-check -p tsconfig.json src/*.ts && tslint --type-check -p tsconfig.json tests/*.ts",
"lint": "tslint --type-check -p tsconfig.json src/*.ts && tslint --type-check -p tsconfig.json tests/*.ts",
"prebuild": "npm run clean",
"build": "tsc -p .",
"postbuild": "npm run bundle",
"bundle": "rollup -c rollup.config.js",
"watch": "tsc -w -p .",
"clean": "rimraf coverage/* && rimraf lib/*",
"prepublishOnly": "npm run clean && npm run build",
"build:browser":
"browserify ./lib/bundle.umd.js --i apollo-utilities -o=./lib/bundle.js && npm run minify:browser",
"minify:browser":
"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js",
"build:browser": "browserify ./lib/bundle.umd.js --i apollo-utilities -o=./lib/bundle.js && npm run minify:browser",
"minify:browser": "uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js",
"filesize": "npm run build && npm run build:browser"
},
"dependencies": {
"apollo-utilities": "^1.0.8"
"apollo-utilities": "^1.0.9"
},
"devDependencies": {
"@types/graphql": "0.12.4",
Expand All @@ -51,7 +48,7 @@
"graphql-tag": "2.8.0",
"jest": "20.0.4",
"rimraf": "2.6.2",
"rollup": "0.56.0",
"rollup": "0.56.4",
"rollup-plugin-node-resolve": "3.0.2",
"ts-jest": "20.0.14",
"tslint": "5.9.1",
Expand All @@ -63,7 +60,12 @@
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
"moduleFileExtensions": ["ts", "tsx", "js", "json"],
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"json"
],
"mapCoverage": true
}
}
37 changes: 20 additions & 17 deletions packages/apollo-client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "apollo-client",
"private": true,
"version": "2.2.5",
"version": "2.2.6",
"description": "A simple yet functional GraphQL client.",
"main": "./lib/bundle.umd.js",
"module": "./lib/index.js",
Expand All @@ -12,18 +12,14 @@
"dev": "./scripts/dev.sh",
"deploy": "./scripts/deploy.sh",
"test": "jest",
"benchmark":
"npm run build:benchmark && node benchmark_lib/benchmark/index.js",
"benchmark:inspect":
"npm run build:benchmark && node --inspect --debug-brk benchmark_lib/benchmark/index.js",
"benchmark": "npm run build:benchmark && node benchmark_lib/benchmark/index.js",
"benchmark:inspect": "npm run build:benchmark && node --inspect --debug-brk benchmark_lib/benchmark/index.js",
"filesize": "npm run build && npm run build:browser",
"type-check": "flow check",
"build": "tsc",
"build:benchmark": "tsc -p tsconfig.benchmark.json",
"build:browser":
"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities --i apollo-cache --i apollo-link --i apollo-link-dedup && npm run minify:browser",
"minify:browser":
"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js",
"build:browser": "browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-utilities --i apollo-cache --i apollo-link --i apollo-link-dedup && npm run minify:browser",
"minify:browser": "uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js",
"watch": "tsc -w",
"bundle": "rollup -c rollup.config.js",
"postbuild": "npm run bundle",
Expand All @@ -50,10 +46,10 @@
"license": "MIT",
"dependencies": {
"@types/zen-observable": "^0.5.3",
"apollo-cache": "^1.1.4",
"apollo-cache": "^1.1.5",
"apollo-link": "^1.0.0",
"apollo-link-dedup": "^1.0.0",
"apollo-utilities": "^1.0.8",
"apollo-utilities": "^1.0.9",
"symbol-observable": "^1.0.2",
"zen-observable": "^0.7.0"
},
Expand All @@ -67,7 +63,7 @@
"@types/jest": "21.1.10",
"@types/lodash": "4.14.102",
"@types/node": "8.5.9",
"apollo-cache-inmemory": "^1.1.9",
"apollo-cache-inmemory": "^1.1.10",
"benchmark": "2.1.4",
"browserify": "15.2.0",
"bundlesize": "0.16.0",
Expand All @@ -80,14 +76,14 @@
"jest": "20.0.4",
"lint-staged": "6.1.0",
"lodash": "4.17.5",
"rollup": "0.56.0",
"rollup": "0.56.4",
"rxjs": "5.5.6",
"ts-jest": "20.0.14",
"tslint": "5.9.1",
"typescript": "2.4.2",
"uglify-js": "3.3.11",
"uglify-js": "3.3.13",
"webpack": "3.10.0",
"webpack-bundle-analyzer": "2.10.0"
"webpack-bundle-analyzer": "2.11.1"
},
"optionalDependencies": {
"@types/async": "2.0.47"
Expand All @@ -97,8 +93,15 @@
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
"moduleFileExtensions": ["ts", "tsx", "js", "json"],
"setupFiles": ["<rootDir>/scripts/tests.js"],
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"json"
],
"setupFiles": [
"<rootDir>/scripts/tests.js"
],
"mapCoverage": true
}
}
Loading

0 comments on commit 0fd8663

Please sign in to comment.