Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

How to use apollo-link-batch-http with Angular? #1267

Open
digeomel opened this issue Apr 29, 2020 · 0 comments
Open

How to use apollo-link-batch-http with Angular? #1267

digeomel opened this issue Apr 29, 2020 · 0 comments

Comments

@digeomel
Copy link

Hi,

we have been using Apollo with Angular 8 for a long time now, using the apollo-angular-link-http module. I thought I'd give the batch http link a try, but it seems it's not exactly a one-to-one replacement for the http-link, as I thought.

Specifically, I tried to replace:

    const apiLink = httpLink.create({
        uri: AppConfig.graphqlEndPoint
    });

with:

    const apiLink = new BatchHttpLink({
        uri: AppConfig.graphqlEndPoint
    });

and I'm getting the error:

NullInjectorError: StaticInjectorError(AppModule)[GraphQLModule -> BatchHttpLink]: 
  StaticInjectorError(Platform: core)[GraphQLModule -> BatchHttpLink]: 
    NullInjectorError: No provider for BatchHttpLink!

Am I missing something?
Thank you in advance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant