GatsbyJs schema correlation with data source

Viewed 26

Trying to create a graphql schema for my app in the form of:

export const createSchemaCustomization = ({ actions }) => {
    const { createTypes } = actions;

    ...

    createTypes(`
        type Posts implements Node @dontInfer {
            id: ID!
            html: String
            rawMarkdownBody: String
            fileAbsolutePath: String
        }
    `);
};

These posts are fetched from local markdown files with gatsby-source-filesystem plugin:

{
    resolve: `gatsby-source-filesystem`,
    options: {
        name: `Posts`,
        path: `${__dirname}/../static/content/collections/posts`
    }
},

When querying with allPosts I can't see any posts. When querying with allMarkdownRemark I can see all posts. How do I correlate the two so I can query on allPosts?

0 Answers
Related