@speedlo/react-apollo-hooks
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -85,5 +85,14 @@ var __assign = (this && this.__assign) || function () { | ||
} | ||
return __assign({}, helpers, { data: data, error: new ApolloOperationError(result.errors && result.errors.length > 0 | ||
? new ApolloError({ graphQLErrors: result.errors }) | ||
: new ApolloError(__assign({}, result.error)), query, variables), errors: result.errors, loading: result.loading, | ||
var apolloError; | ||
if (result.errors && result.errors.length) { | ||
apolloError = new ApolloError({ graphQLErrors: result.errors }); | ||
} | ||
else if (result.error) { | ||
apolloError = new ApolloError(__assign({}, result.error)); | ||
} | ||
var error = apolloError | ||
? new ApolloOperationError(apolloError, query, variables) | ||
: undefined; | ||
return __assign({}, helpers, { data: data, | ||
error: error, errors: result.errors, loading: result.loading, | ||
// don't try to return `networkStatus` when suspense it's used | ||
@@ -90,0 +99,0 @@ // because it's unreliable in that case |
import ApolloClient, { ApolloCurrentResult, ApolloQueryResult, FetchMoreOptions, FetchMoreQueryOptions, NetworkStatus, ObservableQuery, OperationVariables, QueryOptions } from 'apollo-client'; | ||
import { DocumentNode } from 'graphql'; | ||
import { ApolloOperationError } from './ApolloOperationError'; | ||
import { Omit } from './utils'; | ||
export interface QueryHookState<TData> extends Pick<ApolloCurrentResult<undefined | TData>, 'error' | 'errors' | 'loading' | 'partial'> { | ||
data?: TData; | ||
error?: ApolloOperationError; | ||
networkStatus: NetworkStatus | undefined; | ||
@@ -7,0 +9,0 @@ } |
@@ -87,5 +87,14 @@ "use strict"; | ||
} | ||
return __assign({}, helpers, { data: data, error: new ApolloOperationError_1.ApolloOperationError(result.errors && result.errors.length > 0 | ||
? new apollo_client_1.ApolloError({ graphQLErrors: result.errors }) | ||
: new apollo_client_1.ApolloError(__assign({}, result.error)), query, variables), errors: result.errors, loading: result.loading, | ||
var apolloError; | ||
if (result.errors && result.errors.length) { | ||
apolloError = new apollo_client_1.ApolloError({ graphQLErrors: result.errors }); | ||
} | ||
else if (result.error) { | ||
apolloError = new apollo_client_1.ApolloError(__assign({}, result.error)); | ||
} | ||
var error = apolloError | ||
? new ApolloOperationError_1.ApolloOperationError(apolloError, query, variables) | ||
: undefined; | ||
return __assign({}, helpers, { data: data, | ||
error: error, errors: result.errors, loading: result.loading, | ||
// don't try to return `networkStatus` when suspense it's used | ||
@@ -92,0 +101,0 @@ // because it's unreliable in that case |
{ | ||
"name": "@speedlo/react-apollo-hooks", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79745
1328