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

tests: stop using undocumented __resolveObject AS feature #1658

Merged
merged 1 commit into from
Mar 30, 2022

Commits on Mar 29, 2022

  1. tests: stop using undocumented __resolveObject AS feature

    Apollo Server 2.2.1 introduced an experimental feature named
    __resolveObject. It was like an extra-powerful version of
    __resolveReference (which did not yet exist) which also allowed you to
    return references within a single subgraph and they'd be magically
    converted into full objects. It was never documented and was described
    multiple times as experimental.
    
    Its implementation is entirely inside the Apollo Server schema
    instrumentation, which is largely designed for enabling willResolveField
    plugins (eg, usage reporting). In fact, as the developer of the main
    feature in AS 3.6.0
    (apollographql/apollo-server#5963) I added an
    optimization to not call schema instrumentation at all if there are no
    willResolveField plugin hooks... which means that this feature is broken
    in that case!
    
    We are likely to remove this feature in AS4. To get ready for that, stop
    using it in tests here. This involves changing the existing ones to
    `__resolveReference` and also adding some direct "object resolution" to
    resolvers that return objects within the "owning" service.
    
    This is an improvement anyway, so that our fixtures use the documented
    `__resolveReference` feature instead of a different obscure feature.
    glasser committed Mar 29, 2022
    Configuration menu
    Copy the full SHA
    bbedca3 View commit details
    Browse the repository at this point in the history