Cannot return null for non-nullable field



query {
  user {

Query.js file

async function user(parent, args, context) {

  const user = await context.prisma.users({
    where: {
    first: args.first,
    orderBy: args.orderBy,

  return {


module.exports = {


  "data": null,
  "errors": [
      "message": "Cannot return null for non-nullable field",
      "locations": [
          "line": 3,
          "column": 5
      "path": [

what am I doing wrong??


Hi @RecoX,

From the query that you are making I assume you are willing to query the details of a single user. You need to use the user method provided by prisma not the users one. I have made a PR in your . repository fixing you issue.

You are now able to query the user by it’s ID like so:

Let me know if you have any further questions.


Hey @pantharshit00 could you explain why do we have to do it this way??