NextAuth+Hasura:在类型:'users_bool_exp'中找不到`字段'帐户'

问题描述 投票:0回答:1

我正在尝试遵循 nextauth hasura 教程,但出现以下错误:

message: `field 'accounts' not found in type: 'users_bool_exp':
POST /api/auth/signin/github 302 in 8ms
[next-auth][error][adapter_error_getUserByAccount] 
https://next-auth.js.org/errors#adapter_error_getuserbyaccount field 'accounts' not found in type: 'users_bool_exp': {"response":{"errors":[{"message":"field 'accounts' not found in type: 'users_bool_exp'","extensions":{"path":"$.selectionSet.users.args.where.accounts","code":"validation-failed"}}],"status":200,"headers":{}},"request":{"query":"query GetUsers($where: users_bool_exp!) {\n  users(where: $where) {\n    ...User\n  }\n}\n\nfragment User on users {\n  __typename\n  id\n  name\n  email\n  image\n  emailVerified\n}","variables":{"where":{"accounts":{"provider":{"_eq":"github"},"providerAccountId":{"_eq":"790821"}}}}}}

查看调用堆栈显示错误来自 hasura 适配器

    '    at makeRequest (\\node_modules\\graphql-request\\build\\cjs\\index.js:310:15)\n' +
    '    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
    '    at async getUserByAccount (\\node_modules\\next-auth-hasura-adapter\\dist\\index.js:46:25)',
  name: 'Error'

我是 nextauth 和 hasura 的新手,正在寻找解决此问题的技巧。感谢所有帮助。

next-auth hasura hasura-jwt
1个回答
0
投票

我在 next-auth-hasura-adapter github 存储库的问题部分找到了答案。我的 hasura 模式中缺少 users.id 和sessions.userId 之间的关系。

这里是问题的链接:Github Issue

© www.soinside.com 2019 - 2024. All rights reserved.