Skip to content

Relay connections requested with first: 0 read from cache for first: 10 #12697

Open
@tpict

Description

@tpict

Issue Description

When using relayStylePagination, queries that request first: 0 are read from the cache for queries of the same field that request first > 0.

Link to Reproduction

https://github.com/tpict/apollo-connection-first-0-repro

Reproduction Steps

  • Configure a field to use relayStylePagination
  • Perform a query that requests first: 0 and writes the results to cache
  • Perform another query that requests e.g. first: 10

With fetch policies that prefer reads from cache, the latter query will use the results from the former query. This only seems to happen for the first: 0 case e.g. changing it to first: 1 results in the latter query hitting the network for the remaining edges.

@apollo/client version

3.11.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions