What about intuitive API for BatchHttpLink like the one in example of HttpLink?
Seems to me it should look similar with BatchHttpLink to prevent dumb errors:
import ApolloClient from 'apollo-client';
import { BatchHttpLink } from 'apollo-link-batch-http';
const batchLink = new BatchHttpLink({
uri: 'https://example.com/graphql',
// Additional fetch options like `credentials` or `headers`
credentials: 'same-origin',
});
const client = new ApolloClient({
batchLink,
// other options like cache
});
Came here looking for this. Looks like it's already planned. From the Batch Http Link docs:
Note: This package will be updated to remove the dependency on apollo-fetch an use the same options / API as the http-link
Thank you for opening an issue! We are planning to move batching into apollo-link-http. If you have any comments, please add them to #364!
That means that batching will use the same credentials settings as a single request.
Most helpful comment
Thank you for opening an issue! We are planning to move batching into
apollo-link-http. If you have any comments, please add them to #364!That means that batching will use the same credentials settings as a single request.