Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/deduplication-from-request
Browse files Browse the repository at this point in the history
  • Loading branch information
igaloly authored May 24, 2020
2 parents f52ecd8 + 3d48f9f commit 71dabcf
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@
- `useQuery`: Prevent new data re-render attempts during an existing render. This helps avoid React 16.13.0's "Cannot update a component from inside the function body of a different component" warning (https://github.com/facebook/react/pull/17099). <br/>
[@hwillson](https://github.com/hwillson) in [#6107](https://github.com/apollographql/apollo-client/pull/6107)

- Expand `ApolloError` typings to include `ServerError` and `ServerParseError`. <br/>
[@dmarkow](https://github.com/dmarkow) in [#6319](https://github.com/apollographql/apollo-client/pull/6319)

## Apollo Client 2.6.8

### Apollo Client (2.6.8)
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apollo/client",
"version": "3.0.0-beta.49",
"version": "3.0.0-beta.50",
"description": "A fully-featured caching GraphQL client.",
"private": true,
"keywords": [
Expand Down
6 changes: 4 additions & 2 deletions src/errors/ApolloError.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { GraphQLError } from 'graphql';

import { isNonEmptyArray } from '../utilities/common/arrays';
import { ServerParseError } from '../link/http/parseAndCheckHttpResponse';
import { ServerError } from '../link/utils/throwServerError';

export function isApolloError(err: Error): err is ApolloError {
return err.hasOwnProperty('graphQLErrors');
Expand Down Expand Up @@ -34,7 +36,7 @@ const generateErrorMessage = (err: ApolloError) => {
export class ApolloError extends Error {
public message: string;
public graphQLErrors: ReadonlyArray<GraphQLError>;
public networkError: Error | null;
public networkError: Error | ServerParseError | ServerError | null;

// An object that can be used to provide some additional information
// about an error, e.g. specifying the type of error this is. Used
Expand All @@ -51,7 +53,7 @@ export class ApolloError extends Error {
extraInfo,
}: {
graphQLErrors?: ReadonlyArray<GraphQLError>;
networkError?: Error | null;
networkError?: Error | ServerParseError | ServerError | null;
errorMessage?: string;
extraInfo?: any;
}) {
Expand Down
2 changes: 1 addition & 1 deletion src/react/context/ApolloContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface ApolloContextValue {

// If Symbol's aren't available, we'll use a fallback string as the context
// property (we're looking at you, IE11).
const contextSymbol = typeof Symbol === 'function' ?
const contextSymbol = typeof Symbol === 'function' && Symbol.for ?
Symbol.for('__APOLLO_CONTEXT__') :
'__APOLLO_CONTEXT__';

Expand Down

0 comments on commit 71dabcf

Please sign in to comment.