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

GraphQLError: Cannot query field "langKey" on type "MdxFields" #124

Open
dandyweng opened this issue May 9, 2020 · 2 comments
Open

GraphQLError: Cannot query field "langKey" on type "MdxFields" #124

dandyweng opened this issue May 9, 2020 · 2 comments

Comments

@dandyweng
Copy link

Hello,

I'm trying to use this plugin with MDX. I noticed that MDX support was added in #93, but there are no examples provided on how actually to work with MDX files. I assumed this would work:

// gatsby-config.js
plugins: [
  {
    resolve: 'gatsby-plugin-i18n',
    options: {        
      langKeyDefault: 'en',
      useLangKeyLayout: false,
      markdownRemark: {
        postPage: 'src/templates/blog-post.js',
        query: `
          {
            allMdx {
              edges {
                node {
                  fields {
                    slug,
                    langKey
                  }
                }
              }
            }
          }
        `
      }
    }
  }
]

But I got this error message:

"gatsby-plugin-i18n" threw an error while running the createPages lifecycle:

Cannot query field "langKey" on type "MdxFields".

GraphQLError: Cannot query field "langKey" on type "MdxFields".

Does anyone know the right way of doing this?
Thanks

@shreyasminocha
Copy link

No new releases of the package have been published to npm since #93. @angeloocana Could you please publish a new release?

@bolonio
Copy link

bolonio commented May 31, 2020

Hi @angeloocana, could you please publish a new release? As @shreyasminocha mentioned, the support for mdx was already merged. Thanks :)

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