Javascript 错误未知类型“;网络表单“网络表单”;使用gatsbydrupalwebform&;图形ql
在我的gatsby js站点中使用gatsby drupal webform时,我遇到此错误:Javascript 错误未知类型“;网络表单“网络表单”;使用gatsbydrupalwebform&;图形ql,javascript,reactjs,drupal,graphql,gatsby,Javascript,Reactjs,Drupal,Graphql,Gatsby,在我的gatsby js站点中使用gatsby drupal webform时,我遇到此错误: Failed to compile GraphQL Error Unknown type "webform__webform". Did you mean "date_format__date_format"? file: C:/xampp/htdocs/drupal-gatsby-t/node_modules/gatsby-drupal-webform/dist/Webform.jsx
Failed to compile
GraphQL Error Unknown type "webform__webform". Did you mean "date_format__date_format"?
file: C:/xampp/htdocs/drupal-gatsby-t/node_modules/gatsby-drupal-webform/dist/Webform.jsx
1 |
> 2 | fragment Webform on webform__webform {
| ^
3 | name: drupal_internal__id
4 | description
5 | status
6 | elements {
7 | name
8 | _type
9 | _title
10 | _title_display
11 | _default_value
12 | _description
我是这个模块的作者。这个问题中使用的软件包版本很旧,如果没有当时未发布的Drupal hacks,它就无法工作 我建议通过运行
npm install gatsby drupal更新到最新版本-webform@latest--保存
然后,您还需要:
- 从Drupal存储库安装。此模块将预处理Webform jsonapi输出,并打开用于提交表单的REST端点
- 让Gatsby使用
访问任何Web表单配置的权限访问Drupal jsonapi。这可以通过为Drupal安装
模块以及在basic_auth
设置中具有该权限的用户来完成gatsby source Drupal
您可以看看project。为了便于阅读,我对问题进行了编辑,但还需要更多信息,例如您希望实现什么?你尝试了什么?嘿@EricLavault我正在使用Gatsby(React)构建一个完全解耦的Drupal 8站点。该网站需要一个表单。为此,我将使用WebFormDrupal模块,然后使用graphql获取webform查询,并将其与gatsby drupal webform插件一起使用