prismic-gatsby: Fragment cannot be spread here as objects of type.

Running into this issue with my graphql that worked in V2 but throwing this error in V3. “gatsby-source-prismic”: “^3.0.0-beta.11”,

Fragment cannot be spread here as objects of type “PrismicAllDocumentTypes” can never be of type “PrismicIcon”.

Anyone know why this might be happening. I’m presuming its to do with the new way queries handle linked documents. But can’t seem to figure out what I’m doing wrong ?

export const query = graphql`
  query AboutPageQuery {
    page: prismicAboutPage {
      type
      uid
      data {
        careers_title
        corporate_icon: careers_corporate_icon {
          document {
            ... on PrismicIcon {
              data {
                name
              }
            }
          }
        }
      }
    }
  }
`;

My Schema is

{
  "Main" : {
    "uid" : {
      "type" : "UID",
      "config" : {
        "label" : "Slug"
      }
    },
    "page_name" : {
      "type" : "Text",
      "config" : {
        "label" : "Page Name",
        "useAsTitle" : true
      }
    }
  },
  "Careers" : {
    "careers_title" : {
      "type" : "Text",
      "config" : {
        "label" : "Careers Title"
      }
    },
    "careers_corporate_icon" : {
      "type" : "Link",
      "config" : {
        "select" : "document",
        "customtypes" : [ "icon" ],
        "label" : "Careers Corporate Icon"
      }
    }
  }
}

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

@chapster11 Sorry, I didn’t realize I had public DMs turned off. Could you try again?