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

Expose subscription ID to subscription data fetchers #999

Closed
wants to merge 1 commit into from

Commits on Apr 21, 2022

  1. Expose subscription ID to subscription data fetchers

    DgsSSESubscriptionHandler was generating the subscription ID returned to the client,
    but there was no way for the subscription data fetcher to get access to this ID,
    which is useful for logging and debugging purposes. To rectify that, change
    DgsSSESubscriptionHandler to use a Flux directly, which allows us to propagate
    the subscription id in the context.
    
    Now that DgsSSESubscriptionHandler is opinionated about which Publisher implementation
    it uses, a lot of the code was also simplified by avoiding adapting the subscription
    Publisher to the SseEmitter ourselves; instead the controller method simply returns
    a Flux directly and lets Spring handle that. Another change is that any error condition
    occurring before the GraphQL query is executed successfully (e.g., a Publisher is returned)
    will result in a non-SSE response; that is, the status code of the response will
    be non-200, and the error message will no longer be written as a single server-sent event.
    kilink committed Apr 21, 2022
    Configuration menu
    Copy the full SHA
    81c4aae View commit details
    Browse the repository at this point in the history