import {NgModule} from '@angular/core'; import {ApolloModule, APOLLO_OPTIONS} from '@damienwebdev/apollo-angular'; import {ApolloClientOptions, InMemoryCache} from '@apollo/client/core'; import {HttpLink} from '@damienwebdev/apollo-angular/http'; const uri = '<%= endpoint %>'; // <-- add the URL of the GraphQL server here export function createApollo(httpLink: HttpLink): ApolloClientOptions { return { link: httpLink.create({uri}), cache: new InMemoryCache(), }; } @NgModule({ exports: [ApolloModule], providers: [ { provide: APOLLO_OPTIONS, useFactory: createApollo, deps: [HttpLink], }, ], }) export class GraphQLModule {}