Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import { NgModule } from '@angular/core';
import { ApolloModule, Apollo } from 'apollo-angular';
import { HttpClientModule } from '@angular/common/http';
import { HttpLinkModule, HttpLink } from 'apollo-angular-link-http';
import { InMemoryCache } from 'apollo-cache-inmemory';
@NgModule({
imports:[
HttpClientModule,
ApolloModule,
HttpLinkModule
]
})
export class ApolloConfigModule {
constructor(
private apollo: Apollo,
private httpLink: HttpLink
){
const uri = 'https://api.graph.cool/simple/v1/cjmi9259f0t5a9c'; // Your endpoint goes here
const http = httpLink.create({ uri });
apollo.create({
link: http,
cache: new InMemoryCache(),
connectToDevTools: true
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.