Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@kv/apollo-client / src / client / link / index.ts
Size: Mime:
import { from } from '@apollo/client';
import { UploadLinkOptions, createUploadLink } from 'apollo-upload-client';
import type { ApolloLink, RequestHandler } from '@apollo/client';

import { onErrorLink } from './onError';
import { setHeadersLink } from './setHeaders';

// TODO - remove this when the return type is fixed in `@types/apollo-upload-client`
const createUploadLinkWithCorrectType = (options: UploadLinkOptions) =>
  createUploadLink(options) as unknown as ApolloLink | RequestHandler;

export const createApolloLink = (options: UploadLinkOptions) =>
  from([onErrorLink, setHeadersLink, createUploadLinkWithCorrectType(options)]);