express-graphql icon indicating copy to clipboard operation
express-graphql copied to clipboard

npm package doesn't have updated GraphiQLOptions for subscription config

Open ShaneKeney opened this issue 3 years ago • 29 comments

Not sure where to report issue for npm package in itself so am reporting here. The following is the type file on the latest npm install i.e.

npm install --save express-graphql

via. renderGraphiQL.d.ts

export interface GraphiQLOptions {
    /**
     * An optional GraphQL string to use when no query is provided and no stored
     * query exists from a previous session.  If undefined is provided, GraphiQL
     * will use its own default query.
     */
    defaultQuery?: string;
    /**
     * An optional boolean which enables the header editor when true.
     * Defaults to false.
     */
    headerEditorEnabled?: boolean;
}

Looking at the GitHub repo it seems the additional subscriptionEndpoint? field was added for subscription report. Versioning on npm says 0.12.0 which matches with GitHub versioning but there seems to be a discrepancy and am getting some Typescript errors when trying to use subscriptions because of it.

Seems like npm and GitHub are not in sync.

ShaneKeney avatar Mar 20 '21 07:03 ShaneKeney

@ShaneKeney It looks like the v0.12.0 release does not contain the improved subscription support. I've opened #747 to request the release of that awesome funcitonality.

cowboyd avatar Mar 26 '21 10:03 cowboyd

@ShaneKeney we merge to main and publish from main, so whatever is in main is not necessarily published. This is how graphql, react, and many oss projects work

acao avatar Apr 04 '21 12:04 acao

@acao Is their an estimate as to when subscription support will be published?

ShaneKeney avatar Apr 08 '21 12:04 ShaneKeney

@junminstorage is working on the finishing touches once we’re able to publish graphiql next. We’re all volunteers so no timelines are known

acao avatar Apr 08 '21 14:04 acao

@ShaneKeney , once the https://github.com/graphql/graphiql/pull/1806 is merged and changes are released, I will get PR https://github.com/graphql/express-graphql/pull/739 ready for review within a week or so.

junminstorage avatar Apr 10 '21 00:04 junminstorage

https://github.com/graphql/graphiql/runs/2314562284 it should finally publish when this is run @junminstorage, terribly sorry for the delays. I will be on later in the week!

acao avatar Apr 10 '21 22:04 acao

https://github.com/graphql/graphiql/blob/main/packages/graphiql/CHANGELOG.md#141 here's the release notes by the by! I may be able to create a PR for your PR @junminstorage myself later today, if that helps?

acao avatar Apr 12 '21 17:04 acao

PR is here: https://github.com/graphql/express-graphql/pull/755. @acao can you take a look at it?

junminstorage avatar Apr 13 '21 02:04 junminstorage

@ShaneKeney we release new version which should support your use case. let us know if it works for you.

junminstorage avatar Jun 02 '21 18:06 junminstorage

@junminstorage Seems like no releases were made since November. Or am I missing something?

jeremyzahner avatar Jun 24 '21 15:06 jeremyzahner

@junminstorage Same question as @jeremyzahner . Doesn't seem to be any release since Novemeber. Version 0.12.0 still does not have the support for subscription as explained above.

I get the following error:

Type '{ subscriptionEndpoint: string; }' is not assignable to type 'boolean | GraphiQLOptions | undefined'.
  Object literal may only specify known properties, and 'subscriptionEndpoint' does not exist in type 'GraphiQLOptions'.ts(2322

when the following is used:

graphqlHTTP({
    schema,
    graphiql: { subscriptionEndpoint: `ws://localhost:${PORT}/subscriptions` },
})

ShaneKeney avatar Jul 04 '21 04:07 ShaneKeney

@acao @IvanGoncharov can you help with the release?

junminstorage avatar Jul 05 '21 02:07 junminstorage

Hello, 👋 Thank you very much for the volunteering time of the open-source contributors. I'm willing to contribute and donate time to this project if this means we can have the new release up; We also need it in our organization. Any plans on this or if my time can help speed things up for future releases?

rvalenciano avatar Jul 05 '21 16:07 rvalenciano

Would be great to have subscription support !

psugasti avatar Jul 06 '21 07:07 psugasti

In my free time, I'm quite busy with higher priority OSS work on graphiql at the moment, perhaps @danielrearden would be able to help?

I will hopefully get to this when I can, sorry for the delays

acao avatar Jul 06 '21 10:07 acao

my bad, i don't have permissions to publish this repo. @IvanGoncharov is the only active contributor that does

acao avatar Jul 06 '21 10:07 acao

To clarify, I’ve never had publish permissions for this package. Only the ability to merge PRs

#764 will need to be completed first. I have put in a request for publish permissions again, hopefully they are granted this time!

acao avatar Jul 07 '21 01:07 acao

#764 is still blocked on some integration test suite issues I will address this weekend.

we also need to remove graphql-subscriptions-ws from graphiql/toolkit's optional dependencies, and cut another release of the graphiql monorepo.

acao avatar Jul 09 '21 09:07 acao

Hi @acao , any updates on this?

rvalenciano avatar Jul 13 '21 00:07 rvalenciano

sorry, there are higher priority issues in the graphql ecosystem right now, and we're all working for free! it will take some time

acao avatar Jul 13 '21 09:07 acao

Oh ok, well if any help is needed feel free to ping me. Best!

rvalenciano avatar Jul 14 '21 20:07 rvalenciano

Any updates on this?

NickKelly1 avatar Oct 21 '21 22:10 NickKelly1

@acao @IvanGoncharov can you help with the release? If possible can you grant me or some of us here willing to help the permission to release?

junminstorage avatar Oct 22 '21 01:10 junminstorage

In my opinion, features missing in release could be mitigated by better support for installing from GitHub. Both NPM and Yarn offer ways to install from git, but this package does not auto-build when installed from git, and also does not hold its build artifacts in a traditional ./dist folder. Instead, build artifacts are located in ./resources/npmDist when publishing.

See my issue #785 for more details.

AadamZ5 avatar Oct 22 '21 19:10 AadamZ5

I released a fork of the main branch under https://www.npmjs.com/package/@nkp/express-graphql but it appears while the tests pass the branch isn't production ready there are still some issues.

I'm going to try GraphQL Playground instead for a development frontend.

NickKelly1 avatar Oct 22 '21 19:10 NickKelly1

I'm going to try GraphQL Playground instead for a development frontend.

@NickKelly1, it seems that GraphQL Playground still is unconfigurable to use another subscription fetcher. It still uses subscriptions-transport-ws. What are your plans? It seems like the maintainer is also unable to respond to issues at this time.

AadamZ5 avatar Oct 22 '21 19:10 AadamZ5

I'm going to try GraphQL Playground instead for a development frontend.

@NickKelly1, it seems that GraphQL Playground still is unconfigurable to use another subscription fetcher. It still uses subscriptions-transport-ws. What are your plans? It seems like the maintainer is also unable to respond to issues at this time.

My application supports subprotocols graphql-ws and graphql-transport-ws currently so this isn't an issue for me. Hopefully by the time I remove support for graphql-ws one of these playgrounds is compatible with graphql-transport-ws :crossed_fingers:. Otherwise it'll be forking time.

NickKelly1 avatar Oct 22 '21 20:10 NickKelly1

Anyone still working on this? Is this project still maintained or dead?

mhabegger avatar Mar 11 '22 21:03 mhabegger

This library has been deprecated and this repo will be archived soon. It has been superseded by graphql-http.

Furthermore, if you seek a fully-featured, well-maintained and performant server - I heavily recommend GraphQL Yoga!

enisdenjo avatar Mar 20 '23 12:03 enisdenjo