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

GraphQL Subscriptions #2369

Open
michakfromparis opened this issue Aug 30, 2023 · 0 comments
Open

GraphQL Subscriptions #2369

michakfromparis opened this issue Aug 30, 2023 · 0 comments
Assignees
Labels
contributions welcome design 📐 This issue deals with high-level design of a feature @vendure/core
Milestone

Comments

@michakfromparis
Copy link

michakfromparis commented Aug 30, 2023

As a headless platform, I believe vendure would greatly benefit from an idiomatic way to register new graphql subscriptions.
This would allow the admin UI to avoid polling and immediately react to data changes.

Some users have managed to get them working #1879 but my personal recent attempts were unfruitful.

What seems to be the approach that is most aligned with vendure's coding standards / architecture would be to use the nest resolver decorators so @Subscription can sit along @Mutation & @Query like in the example below

@Resolver('Entity')
export class EntityResolver {

  @Query('entity')
  @Transaction()
  async entity(@Args('id') id: number) {
    ...
  }

  @Mutation('deleteEntity')
  @Transaction()
  async deleteEntity(@Args('id') id: number) {
    ...
  }

  @Subscription('entityDeleted')
  async entityDeleted() {
    ...
  }
}
@michaelbromley michaelbromley moved this to 📅 Planned in Vendure OS Roadmap Aug 30, 2023
@michaelbromley michaelbromley added @vendure/core design 📐 This issue deals with high-level design of a feature contributions welcome labels Aug 30, 2023
@dlhck dlhck moved this from 📅 Planned to 📦 Backlog in Vendure OS Roadmap Sep 24, 2024
@dlhck dlhck added this to the v3.2.0 milestone Sep 27, 2024
@dlhck dlhck self-assigned this Sep 27, 2024
@dlhck dlhck moved this from 📦 Backlog to 📅 Planned in Vendure OS Roadmap Oct 19, 2024
@dlhck dlhck modified the milestones: v3.2.0, v3.1.0 Oct 19, 2024
@michaelbromley michaelbromley pinned this issue Oct 31, 2024
@dlhck dlhck modified the milestones: v3.1.0, v3.2.0 Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributions welcome design 📐 This issue deals with high-level design of a feature @vendure/core
Projects
Status: 📅 Planned
Development

No branches or pull requests

3 participants