创建React App GrpahQL模板入门
一个基于Create React App的GraphQL客户端。
用法
npx create-react-app my-app --template graphql
或者
yarn create react-app my-app --template graphql
该项目是通过引导的。
可用脚本
在项目目录中,可以运行:
yarn codegen
生成GraphQL文档的类型和中间源。 yarn start通过Babel执行相同的操作,但是yarn codegen生成器可以更有效地生成它们。 当您的GraphQL文档数量增加时,我建议在yarn start yarn codegen之前运行yarn codegen 快速启动。
yarn start
在开发模式下运行应用程序。 打开在浏览器中查看它。
如果您进行编辑,则页面将重新加载