Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 3.2.0 #6774

Merged
merged 115 commits into from
Sep 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
7112d03
feature: added support for automatic type inference with typed-docume…
dotansimha Jul 28, 2020
36dc45b
update typed-document-node to 1.0.0
dotansimha Jul 29, 2020
9614c65
update version, move to devDependency, added re-export
dotansimha Aug 4, 2020
c550dc3
update lockfile
dotansimha Aug 4, 2020
af18c78
Move TypedDocumentNode to src/core/types.ts.
benjamn Aug 4, 2020
2e0c725
More tests of TypedDocumentNode and cache.{read,write}{Query,Fragment}.
benjamn Aug 4, 2020
02528dd
Move @graphql-typed-document-node/core back to dependencies.
benjamn Aug 4, 2020
081e604
Merge pull request #6720 from dotansimha/feature/typed-document-node
benjamn Aug 4, 2020
c689897
Add beta tag to npm deploy script.
benjamn Aug 4, 2020
15d6324
Mention PR #6720 in CHANGELOG.md.
benjamn Aug 4, 2020
b883fc6
Bump @apollo/client npm version to 3.2.0-beta.0.
benjamn Aug 4, 2020
96f86d2
Bump `@graphql-typed-document-node/core` to v3 (#6778)
dotansimha Aug 5, 2020
e62c734
Merge branch 'master' into release-3.2
benjamn Aug 6, 2020
6577c4a
Bump @apollo/client npm version to 3.2.0-beta.1.
benjamn Aug 6, 2020
46dd608
Disable feud-stopping logic after any cache eviction. (#6817)
benjamn Aug 10, 2020
fe590bc
Bump @apollo/client npm version to 3.2.0-beta.2.
benjamn Aug 10, 2020
2839ee4
Merge branch 'master' into release-3.2
benjamn Aug 17, 2020
c7b3ccd
Set result.partial only if true in getCurrentResult.
benjamn Aug 14, 2020
1dd9301
Simplify fetchMore loading result simulation.
benjamn Aug 14, 2020
97f3caf
Avoid full reobservation for broadcasts from optimistic transactions.
benjamn Aug 14, 2020
44a5f13
Fix optimistic mutation tests, again.
benjamn Aug 17, 2020
8bb4820
Make it clearer that saveAsLastResult defaults to true.
benjamn Aug 17, 2020
e64b642
Keep ObservableQuery#observe private for now.
benjamn Aug 18, 2020
d61fa8a
Mention PR #6854 in CHANGELOG.md.
benjamn Aug 18, 2020
9866ead
Merge pull request #6854 from apollographql/avoid-full-reobservation-…
benjamn Aug 18, 2020
2e2c645
Merge branch 'master' into release-3.2.
benjamn Aug 18, 2020
ac7717a
Bump @apollo/client npm version to 3.2.0-beta.3.
benjamn Aug 18, 2020
d183c22
Use context to track whether reading within @client subtree.
benjamn Aug 19, 2020
5023915
Merge branch 'master' into release-3.2.
benjamn Aug 20, 2020
45179b9
Generalize listening API for reactive variables.
benjamn Aug 20, 2020
2f494c8
Implement useReactiveVar hook.
benjamn Aug 20, 2020
141794c
Mention PR #6867 in CHANGELOG.md.
benjamn Aug 20, 2020
002e199
Docs for useReactiveVar.
benjamn Aug 20, 2020
b9382b0
Avoid visiting new listeners added by other listeners.
benjamn Aug 20, 2020
b874104
Store broadcastable caches separately from listeners.
benjamn Aug 20, 2020
83e2c1b
Merge pull request #6867 from apollographql/useReactiveVar
benjamn Aug 20, 2020
d89d728
Bump @apollo/client npm version to 3.2.0-beta.4.
benjamn Aug 20, 2020
583f62b
Throw when writeFragment cannot identify object
Aug 18, 2020
112228f
Warn if object cannot be identified
Aug 20, 2020
a2f90df
Add stringified result to error message
Aug 21, 2020
ea5a356
Mention PR #6859 in CHANGELOG.md.
benjamn Aug 21, 2020
766d3ff
Merge pull request #6859 from apollographql/writeFragment-identity-error
benjamn Aug 21, 2020
24a4396
Check structural equality in QueryInfo#setDiff. (#6891)
benjamn Aug 24, 2020
c4d100f
Use nextFetchPolicy when polling to restore original policy.
benjamn Aug 24, 2020
0bacd98
Use nextFetchPolicy in ObservableQuery#{refetch,setVariables}, too.
benjamn Aug 24, 2020
1ae25cc
Allow options.nextFetchPolicy to be a function.
benjamn Aug 24, 2020
f38d259
Mention PR #6893 in CHANGELOG.md.
benjamn Aug 25, 2020
03ee726
Merge pull request #6893 from apollographql/nextFetchPolicy-improvements
benjamn Aug 25, 2020
14091ce
Bump @apollo/client npm version to 3.2.0-beta.5.
benjamn Aug 25, 2020
00c4a13
Consider cache.modify a destructive method, like cache.evict.
benjamn Aug 25, 2020
889d103
Mention PR #6898 in CHANGELOG.md.
benjamn Aug 25, 2020
53455f5
Regression test for PRs #6898 and #6817.
benjamn Aug 25, 2020
5b9581b
Merge pull request #6898 from apollographql/consider-cache.modify-des…
benjamn Aug 25, 2020
75499a7
Merge branch 'main' into release-3.2.
benjamn Aug 25, 2020
cb46484
Bump @apollo/client npm version to 3.2.0-beta.6.
benjamn Aug 25, 2020
aae3a1e
Merge branch 'main' into release-3.2.
benjamn Aug 27, 2020
95d2a75
Bump @apollo/client npm version to 3.2.0-beta.7.
benjamn Aug 27, 2020
1a601d8
Ensure cache.{evict,modify} not wrapped more than once.
benjamn Aug 28, 2020
ab5a4f0
Better type inference for {Query,Subscription,Mutation}.propTypes.
benjamn Aug 28, 2020
4908ad7
Bump @apollo/client npm version to 3.2.0-beta.8.
benjamn Aug 28, 2020
c2ef68f
Revert "Check structural equality in QueryInfo#setDiff. (#6891)"
benjamn Aug 28, 2020
0c04a83
Bump @apollo/client npm version to 3.2.0-beta.9.
benjamn Aug 28, 2020
e52d0fb
Merge branch 'main' into release-3.2.
benjamn Aug 30, 2020
d3d4b3b
Hoist shared details out of EntityStore#modify forEach loop.
benjamn Aug 27, 2020
558d1ef
Allow cache.modify to invalidate fields without altering them.
benjamn Aug 27, 2020
8911805
Provide options.storage to cache.modify functions, too.
benjamn Aug 22, 2020
a8758de
Never let options.storage be null.
benjamn Sep 8, 2020
47c00e7
Make EntityStore.Root responsible for options.storage management.
benjamn Sep 8, 2020
bd66129
Add more tests of options.storage, including cache.modify.
benjamn Sep 8, 2020
95f1a6f
Bump bundlesize limit to 24.7kB.
benjamn Sep 8, 2020
59d5940
Mention PR #6991 in CHANGELOG.md.
benjamn Sep 8, 2020
d1fceb6
Documentation for cache.modify details.INVALIDATE sentinel.
benjamn Sep 8, 2020
2c15bb4
Mention details.INVALIDATE in cache.modify API docs.
benjamn Sep 8, 2020
6e3c999
Merge pull request #6991 from apollographql/cache.modify-invalidation
benjamn Sep 8, 2020
f4d214b
Merge branch 'main' into release-3.2.
benjamn Sep 8, 2020
e086a40
Bump @apollo/client npm version to 3.2.0-beta.10.
benjamn Sep 8, 2020
7c06ad2
Merge branch 'main' into release-3.2.
benjamn Sep 9, 2020
c4a09b7
Eliminate unnecessary StoreReader#readQueryFromStore method.
benjamn Aug 20, 2020
065d317
Use getFragmentFromSelection helper in executeSelectionSet.
benjamn Aug 22, 2020
990a488
Invert storage of subtype-supertype relationships in Policies class.
benjamn Aug 21, 2020
1c54969
Bring back heuristic fragment matching, with a twist.
benjamn Aug 22, 2020
92a04db
Return early when inexact fragment type condition is unknown.
benjamn Aug 22, 2020
fcbc86f
Check selectionSetMatchesResult before checking fuzzy subtypes.
benjamn Aug 26, 2020
ae4a6f5
Add more tests of possibleTypes and fragmentMatches.
benjamn Sep 10, 2020
02b0ac8
Mention PR #6901 in CHANGELOG.md.
benjamn Sep 10, 2020
4a22dcb
Merge pull request #6901 from apollographql/heuristic-fragment-matchi…
benjamn Sep 10, 2020
0d510d4
Bump @apollo/client npm version to 3.2.0-beta.11.
benjamn Sep 10, 2020
ccb0a79
Remove invariant forbidding cache-only FetchPolicy in refetch.
benjamn Sep 10, 2020
59e9049
Initialize ObservableQuery in updateObservableQuery even if skip is t…
mu29 Sep 10, 2020
7e94986
Merge branch 'main' into release-3.2.
benjamn Sep 10, 2020
09c0249
Update CHANGELOG.md for recent release-3.2 changes.
benjamn Sep 10, 2020
cd6ff47
Bump @apollo/client npm version to 3.2.0-beta.12.
benjamn Sep 10, 2020
0c98c59
Add new persisted-queries deps
hwillson Aug 14, 2020
4029053
Initial persisted-queries code migration with modifications
hwillson Aug 14, 2020
ad01106
Add the persisted-queries entry point
hwillson Aug 14, 2020
b951c8f
Add @apollo/client/link/persisted-queries to the exports test
hwillson Aug 14, 2020
e255e76
Make `crypto-hash` a dev dep
hwillson Aug 24, 2020
802a0ba
Ensure a `sha256` or `generateHash` function is provided
hwillson Aug 24, 2020
2f7abb5
Adjust tests to accommodate required sha256/generateHash options
hwillson Aug 24, 2020
349296c
Stop unnecessarily exporting `defaultOptions`
hwillson Aug 24, 2020
e4a32ef
Add link docs
hwillson Sep 10, 2020
3e3f5e7
Simplify createPersistedQueryLink options processing.
benjamn Sep 11, 2020
ce4d702
Allow GenerateHashFunction to return string | PromiseLike<string>.
benjamn Sep 11, 2020
68d3911
Use WeakMap to avoid adding Symbol properties to DocumentNode objects.
benjamn Sep 11, 2020
b333475
Simplify confusingly-named operationIsQuery helper.
benjamn Sep 11, 2020
8ad97aa
Support @apollo/client/link/persisted-queries in imports transform.
benjamn Sep 11, 2020
701eb3b
Mention PR #6837 in CHANGELOG.md.
benjamn Sep 11, 2020
f2b60c5
Merge pull request #6837 from apollographql/persisted-queries-link
benjamn Sep 11, 2020
62facae
Respect errorPolicy for mutation and subscription results. (#7003)
benjamn Sep 11, 2020
5441987
Bump @apollo/client npm version to 3.2.0-rc.0.
benjamn Sep 11, 2020
88afcd4
Merge branch 'main' into release-3.2.
benjamn Sep 14, 2020
9d3c847
Make CHANGELOG.md note about TypedDocumentNode more precise.
benjamn Sep 14, 2020
27304e2
Reorganize change list for v3.2.0.
benjamn Sep 14, 2020
b977779
Remove --tag beta from npm deploy command.
benjamn Sep 14, 2020
062b76b
Bump @apollo/client npm version to 3.2.0. :tada:
benjamn Sep 14, 2020
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
Prev Previous commit
Next Next commit
Set result.partial only if true in getCurrentResult.
If result.partial is logically false, letting it remain undefined (and
thus falsy) is also allowed by the ?:boolean type of the field. We should
be consistent about omitting the partial field when it's falsy, unless we
want to be consistent about making it always either true or false, which
would likely be a more disruptive change.
  • Loading branch information
benjamn committed Aug 17, 2020
commit c7b3ccda4a44c06780b03e319b84fa1f240224fe
27 changes: 16 additions & 11 deletions src/core/ObservableQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ export class ObservableQuery<
const { fetchPolicy = 'cache-first' } = this.options;
if (fetchPolicy === 'no-cache' ||
fetchPolicy === 'network-only') {
result.partial = false;
// Similar to setting result.partial to false, but taking advantage
// of the falsiness of missing fields.
delete result.partial;
} else if (
!result.data ||
// If this.options.query has @client(always: true) fields, we cannot
Expand All @@ -154,20 +156,23 @@ export class ObservableQuery<
!this.queryManager.transform(this.options.query).hasForcedResolvers
) {
const diff = this.queryInfo.getDiff();
result.partial = !diff.complete;
result.data = (
diff.complete ||
this.options.returnPartialData
) ? diff.result : void 0;
// If the cache diff is complete, and we're using a FetchPolicy that
// terminates after a complete cache read, we can assume the next
// result we receive will have NetworkStatus.ready and !loading.
if (diff.complete &&
result.networkStatus === NetworkStatus.loading &&
(fetchPolicy === 'cache-first' ||
fetchPolicy === 'cache-only')) {
result.networkStatus = NetworkStatus.ready;
result.loading = false;
if (diff.complete) {
// If the diff is complete, and we're using a FetchPolicy that
// terminates after a complete cache read, we can assume the next
// result we receive will have NetworkStatus.ready and !loading.
if (result.networkStatus === NetworkStatus.loading &&
(fetchPolicy === 'cache-first' ||
fetchPolicy === 'cache-only')) {
result.networkStatus = NetworkStatus.ready;
result.loading = false;
}
delete result.partial;
} else {
result.partial = true;
}
}

Expand Down
8 changes: 1 addition & 7 deletions src/core/__tests__/ObservableQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,6 @@ describe('ObservableQuery', () => {
data: dataOne,
loading: false,
networkStatus: 7,
partial: false,
});
resolve();
});
Expand Down Expand Up @@ -1406,7 +1405,6 @@ describe('ObservableQuery', () => {
data: dataOne,
loading: false,
networkStatus: NetworkStatus.ready,
partial: false,
});
}).then(resolve, reject);
});
Expand Down Expand Up @@ -1502,7 +1500,7 @@ describe('ObservableQuery', () => {
const queryManager = mockQueryManager(reject, {
request: { query, variables },
result: { data: dataOne, errors: [error] },
},
},
// FIXME: We shouldn't need a second mock, there should only be one network request
{
request: { query, variables },
Expand Down Expand Up @@ -1651,15 +1649,13 @@ describe('ObservableQuery', () => {
data: void 0,
loading: true,
networkStatus: 1,
partial: false,
});

subscribeAndCount(reject, observable, (handleCount, subResult) => {
if (handleCount === 1) {
expect(subResult).toEqual({
loading: true,
networkStatus: NetworkStatus.loading,
partial: false,
});
} else if (handleCount === 2) {
expect(subResult).toEqual({
Expand Down Expand Up @@ -1696,7 +1692,6 @@ describe('ObservableQuery', () => {
data: undefined,
loading: true,
networkStatus: 1,
partial: false,
});

subscribeAndCount(reject, observable, (handleCount, subResult) => {
Expand All @@ -1711,7 +1706,6 @@ describe('ObservableQuery', () => {
data,
loading,
networkStatus,
partial: false,
});
} else if (handleCount === 2) {
expect(stripSymbols(subResult)).toEqual({
Expand Down