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

Ensure startup errors are redacted even the first time #5064

Merged
merged 1 commit into from Mar 26, 2021

Commits on Mar 26, 2021

  1. Ensure startup errors are redacted even the first time

    This is a regression in #4981. If the server start process is begun implicitly
    by the execution of an operation (ensureStarted inside graphQLServerOptions) and
    startup throws, the log-and-redact logic wasn't being invoked.
    
    Note that this case doesn't usually happen in practice, because:
    - If you're using `apollo-server`, startup is begun in `listen()` before you can
      serve requests
    - If you're using a serverless framework integration, startup is begun in the
      constructor
    - If you're using a non-serverless framework integration, the function you call
      to connect it to your framework begins startup with `ensureStarting()`
    
    So mostly this just affects the case that you're running `executeOperation`
    without calling `start()` or `listen()`, or maybe you have your own custom
    framework integration that doesn't call `ensureStarting()`. But it's still worth
    missing.
    
    Add some tests of this behavior and fix some TypeScript issues in the test file.
    glasser committed Mar 26, 2021
    Configuration menu
    Copy the full SHA
    285c5a5 View commit details
    Browse the repository at this point in the history