I am confused, do we have to use datamodel.prisma ...
# orm-help
a
I am confused, do we have to use datamodel.prisma or schema.graphql for updating changes in our data model?
I have
Copy code
type Home {
  id: ID! @id
  createdAt: DateTime! @createdAt
  description: String!
  url: String!
  name: String!
  location: String!
  postedBy: User
}

type User {
  id: ID! @id
  name: String!
  email: String! @unique
  password: String!
  homes: [Home!]!
}
Copy code
scalar DateTime

type Query {
  info: String!
  feed(filter: String, skip: Int, first: Int, orderBy: HomeOrderByInput): Feed!
  home(id: ID!): Home
  me: User!
}

enum HomeOrderByInput {
  description_ASC
  description_DESC
  url_ASC
  url_DESC
  createdAt_ASC
  createdAt_DESC
}

type Feed {
  homes: [Home!]!
  count: Int!
}

type Mutation {
  post(url: String!, description: String!, name: String!, location: String!): Home!
  signup(email: String!, password: String!, name: String!): AuthPayload
  login(email: String!, password: String!): AuthPayload
}

type Subscription {
  newHome: Home
}

type AuthPayload {
  token: String
  user: User
}

type User {
  id: ID!
  name: String!
  email: String!
  homes: [Home!]!
}

type Home {
  id: ID!
  createdAt: DateTime!
  description: String
  url: String
  name: String
  location: String
  postedBy: User
  images: [Image!]!
}

type Image {
    id: ID!
    name: String!
    createdAt: DateTime!
    description: String!
    uploadedBy: User!
    home: Home!
}

type ImageList {
    images: [Image!]!
    count: Int!
}
Home and User should be repeated?
Probably I should use # import User
r
Hey @Alejandro Sanchez 👋 Yes Home and User would need to be repeated as that is your
schema.graphql
that you will be exposing to the client via the GraphQL API. If you do not want to manually create the
schema.graphql
you can use Nexus.