Created
December 10, 2020 18:37
-
-
Save roytouw7/f7f084b6bcde7d948d481606453e5631 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 { CommonModule } from '@angular/common'; | |
import { environment } from 'src/environments/environment'; | |
import { ApolloBoost, ApolloBoostModule } from 'apollo-angular-boost'; | |
import { HttpClientModule } from '@angular/common/http'; | |
@NgModule({ | |
declarations: [], | |
imports: [CommonModule], | |
exports: [HttpClientModule, ApolloBoostModule], | |
}) | |
export class GraphqlModule { | |
constructor(apolloBoost: ApolloBoost) { | |
apolloBoost.create({ | |
uri: environment.FAUNA_ENDPOINT, | |
request: async (operation) => { | |
const token = ''; | |
operation.setContext({ | |
headers: { | |
Authorization: `Bearer ${environment.FAUNA_KEY}`, | |
}, | |
}); | |
}, | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment