Following the Apollo Angular docs, I applied this configuration to connect to a given graphql endpoint:
import { HttpClientModule } from "@angular/common/http";
import { ApolloModule, APOLLO_OPTIONS } from "apollo-angular";
import { HttpLinkModule, HttpLink } from "apollo-angular-link-http";
import { InMemoryCache } from "apollo-cache-inmemory";
@NgModule({
imports: [
BrowserModule,
HttpClientModule,
ApolloModule,
HttpLinkModule
],
providers: [{
provide: APOLLO_OPTIONS,
useFactory: (httpLink: HttpLink) => {
return {
cache: new InMemoryCache(),
link: httpLink.create({
uri: "https://my.endpoint.io/graphql"
})
}
},
deps: [HttpLink]
}],
})
export class AppModule {}
Is it possible to use this same configuration to connect to another graphql endpoint?
There is this section in the docs that shows how to use multiple clients, but I don't see how I can apply it with apollo-angular-link-http
Thanks.