Skip to content

2.10.1

Compare
Choose a tag to compare
@rohandubal rohandubal released this 15 Feb 17:13

Bug fixes

  • Prepopulate the queries cache with an empty QUERY_ROOT record, to allow optimistic updates of the cache where no queries have been previously performed. (Issue #92, #101)

  • Fix how "cache hits" are determined in queries, to match Apollo behavior. (#90)
    A "cache hit" is defined as all members of the selection set having a non-nil value. For a simple query, (e.g., the HeroNameQuery of the StarWars API), that is an easy mental map:

    Cache hit

    {
      "QUERY_ROOT": { "hero": "#hero" },
      "#hero": { "hero": {"name": "R2-D2", "__typename": "Droid"} }
    }

    Cache misses

    {}
    
    { "QUERY_ROOT": null }
    
    
    { "QUERY_ROOT": {} }
    
    {
      "QUERY_ROOT": { "hero": "#hero" },
      "#hero": { "hero": null }
    }
    
    // Misses because type data is incomplete
    {
      "QUERY_ROOT": { "hero": "#hero" },
      "#hero": { "hero": {"name": "R2-D2"} }
    }

    For more complex queries (like the TwoHeroesQuery), only all values being non-nil will result in a cache hit:
    Cache Hit

    {
      "QUERY_ROOT": {
        "hero": "#hero",
        "hero(episode:EMPIRE)": "#hero(episode:EMPIRE)"
      },
      "#hero": {"name": "R2-D2", "__typename": "Droid"},
      "#hero(episode:EMPIRE)": {"name": "Luke Skywalker", "__typename": "Human"}
    }

    Cache Misses

    {}
    
    { "QUERY_ROOT": null }
    
    
    { "QUERY_ROOT": {} }
    
    {
      "QUERY_ROOT": { "hero": "#hero" },
      "#hero": { "hero": null }
    }
    
    {
      "QUERY_ROOT": {
        "hero": "#hero"
      },
      "#hero": {"name": "R2-D2", "__typename": "Droid"}
    }

    These definitions match the existing Apollo behavior, as verified in additional tests against the
    unmodified Apollo codebase.

Misc. Updates

  • Updated CloudFormation template to include S3 buckets and associated configuration to support complex object integration tests, and added integration tests for S3 uploads and downloads.