“在类型:‘query_root’中找不到字段‘todos’”
如果从应用程序运行查询,我不会收到此错误
但如果它是从 Hasura Console 运行的,请务必获取
为什么?
该应用程序只是 nhost 演示应用程序的副本
-- this is taken from hasura logs when I access http://localhost:3000/protected/todos page
x-hasura-role user
x-hasura-user-id e2edb294-514b-463a-84fa-4a43e004d09a
x-hasura-user-is-anonymous false
也发布在这里
如果您使用 JWT 身份验证,则不能仅从日志中获取角色和用户 ID 并将其发送到标头中,您需要使用有效的 JWT 令牌。 Hasura 引擎将从 JWT 中提取您的会话变量,例如用户 ID 和角色。
https://discord.com/channels/407792526867693568/1287397028804165642/1287798115339862098