TinaMdx fragment not found

I’m using the Gatsby MDX starter and following the Manual Setup for Tina with the MDX packages from https://github.com/tinacms/tinacms/pull/713

I’m getting an error when I try to add the ...TinaMdx fragment to any query (I’ve been trying to use the fragment in GraphiQL, is there any reason it wouldn’t be available there?)

I know the MDX stuff in TinaCMS is still pretty bleeding edge but has anyone seen this error?

I think this was fixed via #1125 and should be released this week. I assume we will cut a release tomorrow, let us know if it’s still an issue after upgrading!

1 Like

Hey I’m trying to use the Mdx fragment with no joy either :frowning:

query($slug: String!) {
    mdx(frontmatter: { slug: { eq: $slug } }) {
        ...TinaMdx
        frontmatter {
            title
            author
        }
        body
    }
}

Hey @Lauren! Thanks for posting. Are you getting an error? Or could you elaborate on the issue?

1 Like

Says it’s an unknown fragment when I swap out the remark query for mdx

        "stack": [
      "GraphQLError: Unknown fragment \"TinaMdx\".",

Is this because you can’t use the fragment in GQL playground? Sorry I’m a noob.

I just tested this in gatsby-demo in the repository and I can’t recreate the issue, so I’ll need a test case to look into it further. You can find the fragment code here. You could also not use the fragment and just write the items out individually…

Yes sorry my bad - I didn’t understand! Got it now thank you.