Hey! I have a `profilePicture` field on my `User` ...
# orm-help
e
Hey! I have a
profilePicture
field on my
User
type that is being returned as null even though I can see the data is there in the database. I have the following setup:
Copy code
// datamodel.prisma

enum ContentType {
  IMAGE
  VIDEO
}

type Content @embedded {
  type: ContentType! @default(value: IMAGE)
  url: String
  publicId: String
}

type User {
  id: ID! @id
  name: String
  username: String! @unique
  profilePicture: Content
  website: String
  bio: String
  email: String! @unique
  phoneNumber: Int
  gender: Gender! @default(value: NOTSPECIFIED)
  following: [User!]! @relation(name: "Following", link: INLINE)
  followers: [User!]! @relation(name: "Followers", link: INLINE)
  likes: [Like!]! @relation(name: "UserLikes")
  comments: [Comment!]! @relation(name: "UserComments")
  password: String!
  resetToken: String
  resetTokenExpiry: String
  posts: [Post!]! @relation(name: "Posts")
  verified: Boolean! @default(value: false)
  permissions: [Permission!]! @default(value: USER)
  createdAt: DateTime! @createdAt
  updatedAt: DateTime! @updatedAt
}
Copy code
// schema.graphql

type User {
  id: ID!
  name: String!
  username: String!
  profilePicture: Content
  website: String
  bio: String
  email: String!
  phoneNumber: Int
  gender: Gender!
  following: [User!]!
  followers: [User!]!
  verified: Boolean
  posts: [Post!]!
  likes: [Like!]!
  comments: [Comment!]!
  permissions: [Permission!]!
}
Like I said there is data in the database but when I run the below query in Playground I get `null`:
Copy code
// query
{
  user(id: "5c8e5fb424aa9a000767c6c0") {
    profilePicture {
      url
    }
  }
}
Copy code
// response
{
  "data": {
    "user": {
      "profilePicture": null
    }
  }
}
Any idea why?
ctx.prisma.user(({ id }), info);
doesn’t return
profilePicture
even though the field exists in
generated/prisma.graphql