Skip to content

A reproduction of an attempt to customize Gatsby schema where Gatsby no longer infers types

License

Notifications You must be signed in to change notification settings

jeffsee55/gatsby-remark-union-issue

Repository files navigation

yarn install
yarn start

Visit http://localhost:8000/___graphql and run the following query

query MyQuery {
  allMarkdownRemark {
    edges {
      node {
        frontmatter {
          blocks {
          	...on BlockHero {
              heroField1
            }
            ...on BlockColumns {
              columnField1
            }
          }
        }
      }
    }
  }
}

The above query should work, but you'll notice the below query won't work since heroField2 and columnField2 aren't explicitly defined in the createSchemaCustomization function found in gatsby-node.js:

query MyQuery {
  allMarkdownRemark {
    edges {
      node {
        frontmatter {
          blocks {
          	...on BlockHero {
              heroField1
              heroField2
            }
            ...on BlockColumns {
              columnField1
              columnField2
            }
          }
        }
      }
    }
  }
}

About

A reproduction of an attempt to customize Gatsby schema where Gatsby no longer infers types

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published