private async getIntrospectSchema( microservice: MicroserviceInterface ): Promise<GraphQLSchema> { const headers = { authorization: '' }; if (this.configAuth.authorization) { const Authorization = Container.get<{ sign: (params) => string }>( this.configAuth.authorization ); headers.authorization = Authorization.sign({ email: microservice.name, id: -1, scope: ['ADMIN'], }); } const makeDatabaseServiceLink = () => createHttpLink({ uri: microservice.link, fetch, headers }); return makeRemoteExecutableSchema({ schema: await introspectSchema(makeDatabaseServiceLink()), link: makeDatabaseServiceLink(), }); }
private async getIntrospectSchema( microservice: MicroserviceInterface ): Promise<GraphQLSchema> { const headers = { authorization: '' }; if (this.configAuth.authorization) { const Authorization = Container.get<{ sign: (params) => string }>( this.configAuth.authorization ); headers.authorization = Authorization.sign({ email: microservice.name, id: -1, scope: ['ADMIN'], }); } const makeDatabaseServiceLink = () => createHttpLink({ uri: microservice.link, fetch, headers }); return makeRemoteExecutableSchema({ schema: await introspectSchema(makeDatabaseServiceLink()), link: makeDatabaseServiceLink(), }); }