After upgrading to 27.0.0
, I'm finding that the prefer-spread
rule is raising ERROR_ARRAY_CONCAT
errors when a concat
method exists on non-iterable objects.
Specifically, this I've witnessed this occurring when chaining an ApolloLink for the ApolloClient. The ApolloLink object defines a static concat
method.
const client = new ApolloClient({
link: authLink.concat(httpLink), //<-- Raises `Array#concat(…)` error
cache: new InMemoryCache({}),
});
In this case, authLink is of type ApolloLink, which has the following type definition:
export declare class ApolloLink {
static empty(): ApolloLink;
static from(links: (ApolloLink | RequestHandler)[]): ApolloLink;
static split(test: (op: Operation) => boolean, left: ApolloLink | RequestHandler, right?: ApolloLink | RequestHandler): ApolloLink;
static execute(link: ApolloLink, operation: GraphQLRequest): Observable<FetchResult>;
static concat(first: ApolloLink | RequestHandler, second: ApolloLink | RequestHandler): ApolloLink;
constructor(request?: RequestHandler);
split(test: (op: Operation) => boolean, left: ApolloLink | RequestHandler, right?: ApolloLink | RequestHandler): ApolloLink;
concat(next: ApolloLink | RequestHandler): ApolloLink;
request(operation: Operation, forward?: NextLink): Observable<FetchResult> | null;
protected onError(error: any, observer?: ZenObservable.Observer<FetchResult>): false | void;
setOnError(fn: ApolloLink["onError"]): this;
}
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too