How to use the postgraphile.postgraphql function in postgraphile

To help you get started, we’ve selected a few postgraphile examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alex-ald / postgraphile-nest / lib / postgraphile.module.ts View on Github external
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' }));
    }
  }
}
github alex-ald / postgraphile-nest / lib / postgraphile.module.ts View on Github external
}
    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' }));
    }
  }
}
github alex-ald / postgraphile-nest / dist / lib / postgraphile.module.js View on Github external
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' }));
        }
    }
};
github alex-ald / postgraphile-nest / dist / lib / postgraphile.module.js View on Github external
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' }));
        }
    }
};

postgraphile

A GraphQL schema created by reflection over a PostgreSQL schema 🐘 (previously known as PostGraphQL)

MIT
Latest version published 1 year ago

Package Health Score

78 / 100
Full package analysis