Graphql-yoga: GraphQLServer.start miss a host argument

Created on 18 May 2018  路  11Comments  路  Source: dotansimha/graphql-yoga

I found no place to listen to specific ip address in the following line
```lang=javascript
combinedServer.listen(this.options.port, () => {

indeed the underline express server's listen method can accept the second parameter as the `host` to listen to, so adding a new option `host` for GraphQLServer.start() is appreciated, like this
```lang=javascript
combinedServer.listen(this.options.port, this.options.host, () => {
statupr-welcome statustale

Most helpful comment

Is there any help required to get this merged? This feature is quite needed.

All 11 comments

Would be great to have a PR adding the host configuration option! 馃檹

There are build issues even if I don't touch anything, due to which I cannot have a PR.

node_modules/@types/node/index.d.ts(167,14): error TS2687: All declarations of 'observable' must have identical modifiers.
node_modules/@types/zen-observable/index.d.ts(8,9): error TS2687: All declarations of 'observable' must have identical modifiers.
src/index.test.ts(53,11): error TS2459: Type 'string | AddressInfo' has no property 'port' and no string index signature.
src/index.ts(368,42): error TS2339: Property 'port' does not exist on type 'string | AddressInfo'.
  Property 'port' does not exist on type 'string'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `rm -rf dist && tsc -d`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!    ~/.npm/_logs/2018-06-04T07_27_26_893Z-debug.log

Is there any help required to get this merged? This feature is quite needed.

Due to inactivity of this issue we have marked it stale. It will be closed if no further activity occurs.

Commenting to keep this open as it is a valid issue that should not be closed. It even has a PR, #399.

Is there a way to change localhost to any ip address?

I had to migrate to apollo-server because of this.

Due to inactivity of this issue we have marked it stale. It will be closed if no further activity occurs.

Hey :wave:, It seems like this issue has been inactive for some time. In need for maintaining clear overview of the issues concerning the latest version of graphql-yoga we'll close it.
Feel free to reopen it at any time if you believe we should futher discuss its content. :slightly_smiling_face:

Been reading through the Prisma docs all day. Was really excited to test this all out for a new GraphQL project we might be doing. Pulled down the example server and this is the very first issue I ran in to. I guess the workaround is to use something else?

Is this still not resolved? Pretty critical feature...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bellomusodiq picture bellomusodiq  路  3Comments

playerx picture playerx  路  5Comments

yesprasad picture yesprasad  路  3Comments

cj picture cj  路  3Comments

2wce picture 2wce  路  4Comments