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

Deprecate apollo-server-testing; allow ASTs for executeOperation #5238

Merged
merged 1 commit into from May 25, 2021

Commits on May 25, 2021

  1. Deprecate apollo-server-testing; allow ASTs for executeOperation

    The `apollo-server-testing` package exports one small function which is
    just a tiny wrapper around `server.executeOperation`. The one main
    advantage it provides is that you can pass in operations as ASTs rather
    than only as strings.
    
    This extra layer doesn't add much value but does require us to update
    things in two places (which cross a package barrier and thus can be
    installed at skewed versions). So for example when adding the second
    argument to `executeOperation` in #4166 I did not bother to add it to
    `apollo-server-testing` too. We've also found that users have been
    confused by the `createTestClient` API (eg #5111) and that some linters
    get confused by the unbound methods it returns (#4724).
    
    So the simplest thing is to just teach people how to use the real
    `ApolloServer` method instead of an unrelated API.
    
    This PR allows you to pass an AST to `server.executeOperation` (just
    like with the `apollo-server-testing` API), and changes the docs to
    recommend `executeOperation` instead of `apollo-server-testing`. It also
    makes some other suggestions about how to test Apollo Server code in a
    more end-to-end fashion, and adds some basic tests for
    `executeOperation`.
    
    Fixes #4952.
    glasser committed May 25, 2021
    Configuration menu
    Copy the full SHA
    c16a550 View commit details
    Browse the repository at this point in the history