Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
aarne opened this issue Feb 11, 2024 · 1 comment
Open

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

aarne opened this issue Feb 11, 2024 · 1 comment
Assignees

Comments

@aarne
Copy link

aarne commented Feb 11, 2024

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:

  • running multiple graph variants in parallel (automatic environments for each branch in CI/CD for example). Each feature branch has a unique domain name based on which appropriate graph configuration is fetched.
  • pre/post processing of user requests in nodejs (custom auth requirements etc)
@YassinEldeeb
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants