Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Types not generated for all files, ambiguous build error #89

@nathonius

Description

@nathonius

It worked once, then decided to quit on me. I'm using gatsby-plugin-graphql-codegen with the default config, not gatsby-plugin-ts. It's very possible I've just done something wrong; I'm new to gatsby and graphql both, but this error message isn't very useful:

warn [gatsby-plugin-graphql-codegen] Cannot read property 'buildError' of undefined
info [gatsby-plugin-graphql-codegen] definition for queries of schema default-gatsby-schema has been updated at

Types are being generated, but missing for at least one file:

import React from 'react';
import { graphql } from 'gatsby';
import { QueryBlogPostBySlug } from '../../graphql-types'; // type error; module graphql-types has no exported member QueryBlogPostBySlug

interface BlogPostProps {
  data: QueryBlogPostBySlug;
}

const BlogPost: React.FC<BlogPostProps> = props => {
  // ...
};

export const query = graphql`
  query BlogPostBySlug($slug: String!) {
    site {
      siteMetadata {
        title
        author
      }
    }
    allButterPost(filter: { slug: { eq: $slug } }) {
      edges {
        node {
          id
          body
          seo_title
          date
          categories {
            name
          }
        }
      }
    }
  }
`;

export default BlogPost;

My query looks fine and runs fine, so I'm not sure what I'm missing. Repo is here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions