nuxt-modules / apollo

Nuxt.js module to use Vue-Apollo. The Apollo integration for GraphQL.
https://apollo.nuxtjs.org
MIT License
955 stars 198 forks source link

Graphql fragments which contain child elements do not return any subset data #411

Open toddpadwick opened 3 years ago

toddpadwick commented 3 years ago

Description

Here is an example fragment for a field that contains child elements:

    fragment landingPageBuilderFrag on landingPageBuilder_MatrixField {
      ... on landingPageBuilder_sectionHeadline_BlockType {
        typeHandle
        sectionTitle
        headline
        introduction
      }
      ... on landingPageBuilder_logoParade_BlockType {
        typeHandle
        organisations {
          url
          title
          slug
          id
          uri
          ... on organisations_organisation_Entry {
            logo {
              extension
              width
              height
              url
              id
              title
              srcset(sizes: ["100", "300", "400"])
            }
          }
        }
      }
      ... on landingPageBuilder_faqs_BlockType {
        typeHandle
        faqs {
                ... on faqs_BlockType {
            question
            answer
          }
        }
        callToAction {
          ... on callToAction_BlockType {
                ... callToActionSuperTableFrag     
          }
        }
      }
    }

I would like to then use this fragment for multiple entry types which contain this field, for example:

    ... on homepage_homepage_Entry {
          landingPageBuilder {
              ...landingPageBuilderFrag
          }
        }

In the GraphiQL explorer and in Postman, this works fine as expected. But when queried via our Nuxt Apollo app it returns an array for each child element but without its subset contents. here is a screenshot of the response in the console:

Screenshot 2021-09-02 at 17 08 23

as you can see non of the subset data is returned for any of the sub-blocks.

Additional info

frieddbm commented 1 year ago

Had the same issue on the current alpha8 release.

@toddpadwick did you resolve the problem?