无法查询 graphql/template-string 类型"Query"上的字段"allDevArticles"以获取 dev.to 文章



我正在使用gatsby源代码开发gatsby插件来获取我的gatsby页面上的所有dev.to文章。https://github.com/geocine/gatsby-source-dev

它工作得很好,但最近它开始给我这个错误。

"无法查询字段";allDevArticles";关于类型";查询";graphql/template字符串";

无法在网站上获取我的最新文章。

我的gatsby-config.js看起来像这个


module.exports = {
plugins: [
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `profile`,
path: `./data`,
},
},
`gatsby-transformer-sharp`,
`gatsby-transformer-json`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-source-dev`,
options: {
username:'vish448'
}
},
],
}

我在页面上的graphql查询看起来像这个

export const query = graphql`
query ArticlePageQuery {
allDevArticles {
nodes {
article {
title
url
published_at(formatString: "DD MMM YYYY")
}
}
}
}`

我已经在gatsby-config.js中为gatsby源代码开发插件更新了配置,它运行良好。所以,基本上,这些字符串引号引起了一个问题。我已将这些引号更改为字符串文字(``(


module.exports = {
plugins: [
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `profile`,
path: `./data`,
},
},
`gatsby-transformer-sharp`,
`gatsby-transformer-json`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-source-dev`,
options: {
**username:`vish448`**
}
},
],
}

最新更新