Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gatsby Build fails - GraphQL Error - Modular Content Fields #13

Closed
drobinhood opened this issue Apr 25, 2018 · 2 comments
Closed

Gatsby Build fails - GraphQL Error - Modular Content Fields #13

drobinhood opened this issue Apr 25, 2018 · 2 comments

Comments

@drobinhood
Copy link

Gatsby fails to build if there isn't a post with at least one of the modular content fields. For instance, if DatoCmsImage isn't used in a post and only DatoCmsText is used gatsby will fail with the following query. See the following build error.

{
  allDatoCmsBlogPost {
    edges {
      node {
        title
        content {
          ... on DatoCmsText {
            text
          }
          ... on DatoCmsImage {
            image {
              url
            }
          }
        }
      }
    }
  }
}

GraphQL Error Fragment cannot be spread here as objects of type "DatoCmsText" can never be of type "DatoCmsImage".

@AdamPflug
Copy link

I believe this is essentially a duplicate of:
gatsbyjs/gatsby#3344
gatsbyjs/gatsby#4261

@stefanoverna
Copy link
Member

stefanoverna commented May 30, 2018

Duplicate of #11

@stefanoverna stefanoverna marked this as a duplicate of #14 May 30, 2018
@stefanoverna stefanoverna marked this as a duplicate of #11 May 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants