我在本地运行 Postgres。我可以使用本地访问数据库,psql postgres:///reviewapp
并且\dt
可以看到一些表。
如果我运行,npx postgraphile -c "postgres:///reviewapp"
我不会在终端中收到任何错误:
PostGraphile v4.12.4 server listening on port 5000
‣ GraphQL API: http://localhost:5000/graphql
‣ GraphiQL GUI/IDE: http://localhost:5000/graphiql (RECOMMENDATION: add '--enhance-graphiql')
‣ Postgres connection: postgres:///reviewapp
‣ Postgres schema(s): public
‣ Documentation: https://graphile.org/postgraphile/introduction/
‣ Node.js version: v14.15.5 on darwin x64
‣ Join Mark in supporting PostGraphile development: https://graphile.org/sponsor/
* * *
但是,当我转到http://localhost:5000/graphql
屏幕上时出现错误:
{"errors":[{"message":"Only
POST requests are allowed."}]}