按照Apollo Angular 文档,我应用此配置连接到给定的 graphql 端点:
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 {}
是否可以使用相同的配置连接到另一个 graphql 端点?
文档中有这个部分显示了如何使用多个客户端,但我看不到如何应用它apollo-angular-link-http
谢谢。