• Phil Pluckthun's avatar
    fix(graphcache): Shift layers with future updates and improve layer behaviour (#2419) · e1278c91
    Phil Pluckthun authored
    * Apply subscription layers as if they carried `hasNext: true`
    
    * Ensure no layers are created for reads
    
    * Shift `hasNext: true` layers to lowest possible layer
    
    Rather than creating new layers on top of all others (unshift)
    if future results for them are expected, we shift them past
    all currently unfilled layers. This is done every time their
    layers are reserved with `hasNext: true`.
    This means that any layer that's currently unfinished will not
    take precedence over newer operations that have been scheduled,
    but will still take precedence over past layers that haven't been
    cleared yet.
    
    * Update tests for deferred layers
    
    * Add optimisation to avoid unnecessary squashing
    
    * Add changesets
    
    * Update .changeset/pink-turkeys-live.md
    Co-authored-by: 's avatarJovi De Croock <decroockjovi@gmail.com>
    Co-authored-by: 's avatarJovi De Croock <decroockjovi@gmail.com>
    e1278c91