Last active
August 7, 2019 23:00
-
-
Save vitorpiovezam/7454d7a6f14042f590b1d67e469195b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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