biteit / nette-react-graphql
包含React前端(使用UrQL)、Nette + Nextras ORM后端以及包含查询代码生成的GraphQL集成的基本工作项目。
1.0
2022-03-14 19:13 UTC
Requires
- php: >=8.0
- nette/application: ^3.1
- nette/bootstrap: ^3.1
- nette/caching: ^3.1
- nette/finder: ^2.5
- nette/http: ^3.1
- nette/mail: ^3.1
- nette/robot-loader: ^3.3
- nette/security: ^3.1
- nette/utils: ^3.2
- nextras/orm: ^4.0
- portiny/graphql-nette: ^6.1
- tracy/tracy: ^2.8
Requires (Dev)
- nette/tester: ^2.3
- symfony/thanks: ^1
This package is auto-updated.
Last update: 2024-09-15 01:09:56 UTC
README
这是一个基本项目,它包括PHP Nette + Nextras ORM作为后端,并使用React + UrQL进行GraphQL API。
- 运行
composer install
- 在
config
文件夹中创建config.local.neon
- 进入
www/app
文件夹 - 运行
yarn install
或npm install
- 进入
www/app/graphql
文件夹,并从schema.graphql
文件运行模式生成 - 运行
yarn schema
生成React的GraphQL模式 - 在
www
文件夹中运行您的PHP服务器(即php -S localhost:8000
) - 运行React应用(在
www/app
文件夹中运行yarn start
) - 您的React应用应该启动,并且您应该在控制台中看到
Hello World
- 这意味着测试GraphQL查询成功运行。