Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

npm package doesn't have updated GraphiQLOptions for subscription config #746

Open
ShaneKeney opened this issue Mar 20, 2021 · 29 comments
Open
Labels

Comments

@ShaneKeney
Copy link

ShaneKeney commented Mar 20, 2021

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.

@cowboyd
Copy link

cowboyd commented Mar 26, 2021

@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.

@acao
Copy link
Member

acao commented Apr 4, 2021

@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

@ShaneKeney
Copy link
Author

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

@acao
Copy link
Member

acao commented Apr 8, 2021

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

@junminstorage
Copy link
Contributor

@ShaneKeney , once the graphql/graphiql#1806 is merged and changes are released, I will get PR #739 ready for review within a week or so.

@acao
Copy link
Member

acao commented Apr 10, 2021

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
Copy link
Member

acao commented Apr 12, 2021

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 acao added the bug label Apr 12, 2021
@junminstorage
Copy link
Contributor

PR is here: #755. @acao can you take a look at it?

@junminstorage
Copy link
Contributor

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

@jeremyzahner
Copy link

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

@ShaneKeney
Copy link
Author

@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` },
})

@junminstorage
Copy link
Contributor

junminstorage commented Jul 5, 2021

@acao @IvanGoncharov can you help with the release?

@rvalenciano
Copy link

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?

@psugasti
Copy link

psugasti commented Jul 6, 2021

Would be great to have subscription support !

@acao
Copy link
Member

acao commented Jul 6, 2021

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
Copy link
Member

acao commented Jul 6, 2021

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

@acao
Copy link
Member

acao commented Jul 7, 2021

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
Copy link
Member

acao commented Jul 9, 2021

#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.

@rvalenciano
Copy link

Hi @acao , any updates on this?

@acao
Copy link
Member

acao commented Jul 13, 2021

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

@rvalenciano
Copy link

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

@NickKelly1
Copy link

Any updates on this?

@junminstorage
Copy link
Contributor

@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?

@AadamZ5
Copy link

AadamZ5 commented Oct 22, 2021

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.

@NickKelly1
Copy link

NickKelly1 commented Oct 22, 2021

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.

@AadamZ5
Copy link

AadamZ5 commented Oct 22, 2021

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.

@NickKelly1
Copy link

NickKelly1 commented Oct 22, 2021

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 🤞. Otherwise it'll be forking time.

@mhabegger
Copy link

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

@enisdenjo
Copy link
Member

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!

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

No branches or pull requests