Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!this.httpAdapterHost) {
return;
}
const httpAdapter = this.httpAdapterHost.httpAdapter;
if (!httpAdapter) {
return;
}
const app = httpAdapter.getInstance();
// Break out PostGraphile options
const {pgConfig, schema, playground, ...postGraphileOptions} = this.options;
if (schema) {
this.postgraphile = postgraphql(pgConfig, schema, postGraphileOptions);
} else {
this.postgraphile = postgraphql(pgConfig, postGraphileOptions);
}
app.use(this.postgraphile);
if (playground) {
app.get('/playground', expressPlayground({ endpoint: '/graphql' }));
}
}
}
}
const httpAdapter = this.httpAdapterHost.httpAdapter;
if (!httpAdapter) {
return;
}
const app = httpAdapter.getInstance();
// Break out PostGraphile options
const {pgConfig, schema, playground, ...postGraphileOptions} = this.options;
if (schema) {
this.postgraphile = postgraphql(pgConfig, schema, postGraphileOptions);
} else {
this.postgraphile = postgraphql(pgConfig, postGraphileOptions);
}
app.use(this.postgraphile);
if (playground) {
app.get('/playground', expressPlayground({ endpoint: '/graphql' }));
}
}
}
onModuleInit() {
if (!this.httpAdapterHost) {
return;
}
const httpAdapter = this.httpAdapterHost.httpAdapter;
if (!httpAdapter) {
return;
}
const app = httpAdapter.getInstance();
const _a = this.options, { pgConfig, schema, playground } = _a, postGraphileOptions = __rest(_a, ["pgConfig", "schema", "playground"]);
if (schema) {
this.postgraphile = postgraphile_1.postgraphql(pgConfig, schema, postGraphileOptions);
}
else {
this.postgraphile = postgraphile_1.postgraphql(pgConfig, postGraphileOptions);
}
app.use(this.postgraphile);
if (playground) {
app.get('/playground', graphql_playground_middleware_express_1.default({ endpoint: '/graphql' }));
}
}
};
onModuleInit() {
if (!this.httpAdapterHost) {
return;
}
const httpAdapter = this.httpAdapterHost.httpAdapter;
if (!httpAdapter) {
return;
}
const app = httpAdapter.getInstance();
const _a = this.options, { pgConfig, schema, playground } = _a, postGraphileOptions = __rest(_a, ["pgConfig", "schema", "playground"]);
if (schema) {
this.postgraphile = postgraphile_1.postgraphql(pgConfig, schema, postGraphileOptions);
}
else {
this.postgraphile = postgraphile_1.postgraphql(pgConfig, postGraphileOptions);
}
app.use(this.postgraphile);
if (playground) {
app.get('/playground', graphql_playground_middleware_express_1.default({ endpoint: '/graphql' }));
}
}
};