Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.
This repository was archived by the owner on Oct 6, 2025. It is now read-only.

Define best practices for big complex queries for Apollo client #15

Description

@Simply007

There are multiple issues that cause the query to be too complex and hit the 8KB request size limit, but these are the ones connected to Apollo client specifically:

  1. Currently it is possible in graphql load linked content items using ˙_Item˙, but the Apollo client that is used here does not map the response data back - see Apollo misses populating properties when fragments are spread apollographql/apollo-client#7648 (comment)
  2. Landing page query is was too complex because it is basically a container for multiple types of sections with different properties (Features Section, Content section, ...) and Landing page query is covering all possible types - this leads to a huge query.
    • Current fix is to disable adding __typename to every object type (default Apollo client behavior) and place __typename only to places where it is absolutely necessary - fixed in 5eb2494
    • If the first problem is fixed, there might be another solution - load only section identification properties (codename and language), pas them to section components and the section component itself would be responsible data fetching. - partly fixed in 5eb2494

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions