We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e43efc commit 8c045c5Copy full SHA for 8c045c5
api/resolvers/user.js
@@ -134,6 +134,9 @@ export default {
134
},
135
user: async (parent, { id, name }, { models }) => {
136
if (id) id = Number(id)
137
+ if (!id && !name) {
138
+ throw new GqlInputError('id or name is required')
139
+ }
140
return await models.user.findUnique({ where: { id, name } })
141
142
users: async (parent, args, { models }) =>
0 commit comments