the-guild-org / conductor

Conductor is a cutting-edge, open-source GraphQL Gateway, fully compliant with the GraphQL specification and designed to supercharge any API with powerful features and proxy flows.
https://the-guild.dev/graphql/gateway
MIT License
93 stars 3 forks source link

Feature Request: Expose http handler via napi to nodejs #433

Open aarne opened 6 months ago

aarne commented 6 months ago

Current usage of @graphql-conductor/lib is strictly limited to running a single standalone server only

import conductor from '@graphql-conductor/lib'

conductor.executeConductor(configFilePath)

For many use-cases this is too limiting. We might want to also expose a lower level api

import conductor from '@graphql-conductor/lib'

const gw = conductor.createGateway(configObject)

const response = await gw.handle(req)

Motivation:

YassinEldeeb commented 6 months ago

This is a really nice suggestion! Having Conductor’s API exposed to Node not just as a standalone server, but also where you can resolve requests without a running server would be indeed really nice and opens many flexibility options for Nodejs users.