跳到内容

razzle-plugin-graphql

此包包含一个插件,用于在 Razzle 中使用 graphql/gql

在 Razzle 项目中使用

yarn add razzle-plugin-graphql --dev

使用默认选项

// razzle.config.js
module.exports = {
plugins: ['graphql'],
};

使用自定义选项

目前不支持选项

选项

目前不支持选项


使用

要使用 .graphql.gql 只需在组件中导入它们即可。

import query from './query.graphql';

console.log(query);
// {
//   "kind": "Document",
// ...

有关更多信息,请参阅 graphql-tag 软件包文档。