Skip to content

Cache Fetch Fails with GraphQLExecutionError for 2D Array Data Structure #3609

@gurusekhar-dev

Description

@gurusekhar-dev

Summary

Description:
When querying data containing a two-dimensional array from the cache, Apollo iOS SDK throws a GraphQLExecutionError with underlying ApolloAPI.JSONDecodingError.wrongType. The data successfully parses and normalizes into the cache during network response, but fails when reading from the cache.

Expected Behavior:

Data should be successfully retrieved from cache with the same structure that was originally parsed from network response

Two-dimensional arrays should maintain their nested structure when reading from cache

Actual Behavior:

Cache read fails with GraphQLExecutionError pointing to specific nested array indices

Error shows ApolloAPI.JSONDecodingError.wrongType suggesting incorrect type conversion

The cache appears to store nested array elements as individual keys (e.g., scores.sets.0.0, scores.sets.0.1) rather than preserving the array structure

Version

Apollo iOS SDK Version: 1.25.3

Xcode Version: V26.1

iOS Version: iOS 26.1

Steps to reproduce the behavior

Execute a GraphQL query that returns data containing a two-dimensional array structure

Data successfully loads from network and normalizes into cache

Subsequent queries for the same data (reading from cache) fail with decoding error

Error occurs at specific path indicating nested array indices (e.g., liveScores.matches.0.scores.sets.0.0)

Logs

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions