bytewitchcraft / apollo-absinthe-upload-link

A network interface for Apollo that enables file-uploading to Absinthe back ends.
62 stars 37 forks source link

How to use with batch-http? #24

Closed quolpr closed 4 years ago

quolpr commented 5 years ago

Is it possible to use https://www.npmjs.com/package/apollo-link-batch-http with this apollo-absinthe-upload-link?

At now I have this setup:

const client = new ApolloClient({
  link: ApolloLink.from([
    new ApolloLink((operation, forward) => {
      return forward!(operation).map(response => {
        return {
          ...response,
          // tslint:disable-next-line:no-any
          data: (response as { payload: { data: any } }).payload.data
        };
      });
    }),
    new BatchHttpLink({
      uri: API_URL,
      credentials: "include"
    })
  ]),
  cache: inMemoryCache,
  resolvers: {}
});
ihorkatkov commented 5 years ago

Hey @quolpr,

I think it should work because the protocol is the same. Have you tried?