Skip to content

Multiple useFragment uses for same fragment data creates large transport size #344

@maciesielka

Description

@maciesielka

👋🏻 We're working on optimizing our Next.js App Router usage as much as we can and came into some possibly unexpected behavior related to the streaming support offered by this package. If this turns out to be expected behavior, that'd still be useful for us to know as well 🙂

Overview

We rely on useFragment to deliver cache updates for singleton data (not unlike a setup similar to what's described by AllProducts in this documentation) to many different components that are rendered at once. Despite the same fragment, each usage of useFragment seems to contribute linearly to the size of the script tag that manages the ApolloSSRDataTransport in the browser as a part of the SSR streaming process. Since we are subscribing to updates for the same location in the cache, we'd expect some kind of deduplication or normalization to prevent so much redundancy.

Example

You can find a reproducing project forked from this repo here.

In order to visualize the problem, follow these steps:

  1. Run the project with yarn dev

  2. Navigate to the new page that uses just one useFragment call at: http://localhost:5001/cc/use-fragment/1

    1. Inspect the page source / ApolloSSRDataTransport script tag for this page

      A pretty-printed example is shown below:
      <script>
        (window[Symbol.for("ApolloSSRDataTransport")] ??= []).push({
          rehydrate: {
            ":Rkvff7qcq:": {
              data: {
                poll: {
                  __typename: "Poll",
                  id: "1",
                  question: "What's your favorite thing about GraphQL?",
                  totalVotes: 4315,
                  answers: [
                    {
                      __typename: "Answer",
                      id: "1",
                      text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                      votes: 1867,
                      percentage: 43.26767091541136,
                    },
                    {
                      __typename: "Answer",
                      id: "2",
                      text: "I get to spend less time writing documentation and more time actually building features.",
                      votes: 787,
                      percentage: 18.238702201622246,
                    },
                    {
                      __typename: "Answer",
                      id: "3",
                      text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                      votes: 1191,
                      percentage: 27.60139049826188,
                    },
                    {
                      __typename: "Answer",
                      id: "4",
                      text: "It makes me feel like a wizard who can magically summon any data I need!",
                      votes: 470,
                      percentage: 10.89223638470452,
                    },
                  ],
                },
              },
              networkStatus: 7,
            },
            ":R3kvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
          },
          events: [
            {
              type: "data",
              id: "1",
              result: {
                data: {
                  poll: {
                    __typename: "Poll",
                    id: "1",
                    question: "What's your favorite thing about GraphQL?",
                    totalVotes: 4315,
                    answers: [
                      {
                        __typename: "Answer",
                        id: "1",
                        text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                        votes: 1867,
                        percentage: 43.26767091541136,
                      },
                      {
                        __typename: "Answer",
                        id: "2",
                        text: "I get to spend less time writing documentation and more time actually building features.",
                        votes: 787,
                        percentage: 18.238702201622246,
                      },
                      {
                        __typename: "Answer",
                        id: "3",
                        text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                        votes: 1191,
                        percentage: 27.60139049826188,
                      },
                      {
                        __typename: "Answer",
                        id: "4",
                        text: "It makes me feel like a wizard who can magically summon any data I need!",
                        votes: 470,
                        percentage: 10.89223638470452,
                      },
                    ],
                  },
                },
              },
            },
            { type: "complete", id: "1" },
          ],
        });
      </script>
  3. In a new tab, navigate to the new page that uses 24 of the same useFragment call at: http://localhost:5001/cc/use-fragment/24

    1. Inspect the page source / ApolloSSRDataTransport script tag for this page. Compare it to the results in step 2.i and see that it's considerably larger and full of mostly redundant information

      Find a pretty-printed example below that includes 23 more duplicate entries for the same Poll data
      <script>
        (window[Symbol.for("ApolloSSRDataTransport")] ??= []).push({
          rehydrate: {
            ":Rkvff7qcq:": {
              data: {
                poll: {
                  __typename: "Poll",
                  id: "1",
                  question: "What's your favorite thing about GraphQL?",
                  totalVotes: 4315,
                  answers: [
                    {
                      __typename: "Answer",
                      id: "1",
                      text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                      votes: 1867,
                      percentage: 43.26767091541136,
                    },
                    {
                      __typename: "Answer",
                      id: "2",
                      text: "I get to spend less time writing documentation and more time actually building features.",
                      votes: 787,
                      percentage: 18.238702201622246,
                    },
                    {
                      __typename: "Answer",
                      id: "3",
                      text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                      votes: 1191,
                      percentage: 27.60139049826188,
                    },
                    {
                      __typename: "Answer",
                      id: "4",
                      text: "It makes me feel like a wizard who can magically summon any data I need!",
                      votes: 470,
                      percentage: 10.89223638470452,
                    },
                  ],
                },
              },
              networkStatus: 7,
            },
            ":R3kvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":R5kvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":R7kvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":R9kvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":Rbkvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":Rdkvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":Rfkvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":Rhkvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":Rjkvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":Rlkvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":Rnkvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":Rpkvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":Rrkvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":Rtkvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":Rvkvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":R11kvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":R13kvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":R15kvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":R17kvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":R19kvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":R1bkvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":R1dkvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":R1fkvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
            ":R1hkvff7qcq:": {
              data: {
                __typename: "Poll",
                id: "1",
                question: "What's your favorite thing about GraphQL?",
                totalVotes: 4315,
                answers: [
                  {
                    __typename: "Answer",
                    id: "1",
                    text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                    votes: 1867,
                    percentage: 43.26767091541136,
                  },
                  {
                    __typename: "Answer",
                    id: "2",
                    text: "I get to spend less time writing documentation and more time actually building features.",
                    votes: 787,
                    percentage: 18.238702201622246,
                  },
                  {
                    __typename: "Answer",
                    id: "3",
                    text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                    votes: 1191,
                    percentage: 27.60139049826188,
                  },
                  {
                    __typename: "Answer",
                    id: "4",
                    text: "It makes me feel like a wizard who can magically summon any data I need!",
                    votes: 470,
                    percentage: 10.89223638470452,
                  },
                ],
              },
              complete: true,
              missing: undefined,
            },
          },
          events: [
            {
              type: "data",
              id: "1",
              result: {
                data: {
                  poll: {
                    __typename: "Poll",
                    id: "1",
                    question: "What's your favorite thing about GraphQL?",
                    totalVotes: 4315,
                    answers: [
                      {
                        __typename: "Answer",
                        id: "1",
                        text: "I love how it gives me an excuse to use the word “schema” in casual conversation.",
                        votes: 1867,
                        percentage: 43.26767091541136,
                      },
                      {
                        __typename: "Answer",
                        id: "2",
                        text: "I get to spend less time writing documentation and more time actually building features.",
                        votes: 787,
                        percentage: 18.238702201622246,
                      },
                      {
                        __typename: "Answer",
                        id: "3",
                        text: "It's like a buffet where I can pick and choose exactly what data I want, without any unwanted side dishes.",
                        votes: 1191,
                        percentage: 27.60139049826188,
                      },
                      {
                        __typename: "Answer",
                        id: "4",
                        text: "It makes me feel like a wizard who can magically summon any data I need!",
                        votes: 470,
                        percentage: 10.89223638470452,
                      },
                    ],
                  },
                },
              },
            },
            { type: "complete", id: "1" },
          ],
        });
      </script>
  4. Feel free to continue testing with as many fragments as you'd like to see how it affects the transport. The number of rendered items is configurable in the URL:

    /cc/use-fragment/[num-items]
    

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