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

[RFC] Cache parsed and validated queries in memory #2170

Closed
wants to merge 1 commit into from

Commits on Jan 10, 2019

  1. [RFC] Cache parsed and validated queries in memory

    A first RFC to kick off a discussion about caching parsed and validated
    queries. This is based on the ideas from [graphql/graphql-js#158](graphql/graphql-js#158)
    
    GraphQL APIs often get the same queries with different variables over
    and over. Even though the query string doesn't change, Apollo server
    parses and validates it on every request.
    
    Instead, we can cache the resulting AST and skip the parsing and
    validation step on further requests with the same query. While I don't
    think this will provide an order of magnitude of a speedup, it seems
    like it would avoid unnecessary work, could help in performance
    sensitive scenarios and doesn't add much complexity.
    
    This commit implements this in a very crude way to kick off a discussion
    about including this in Apollo Server.
    Max Stoiber committed Jan 10, 2019
    Configuration menu
    Copy the full SHA
    f1d3e89 View commit details
    Browse the repository at this point in the history