Giter VIP home page Giter VIP logo

Comments (6)

abhiaiyer91 avatar abhiaiyer91 commented on May 17, 2024 2

All prev data models using the Cat/Master setup is now using this data model

from prisma-examples.

brikou avatar brikou commented on May 17, 2024 1

IMO Post.content or Post.body is better than Post.text, because text may be confusing as too generic and remind a datatype.

from prisma-examples.

brikou avatar brikou commented on May 17, 2024

For me the Advanced datamodel is too simple, we cannot demonstrate real world usage and so real world bug. We should add another model fe. Comment related to Post.

This way we could demonstrate how to chain calls and when to use fragments. One of the keypoint of this new release (1.17) is about chaining methods, so we need another model.
Another keypoint is the generated TS typing quality, to really test it another model is required.

ping @schickling

NB: I'm really excited about 1.17 new features... great job prisma team!

from prisma-examples.

schickling avatar schickling commented on May 17, 2024

Great point @brikou. I've renamed my datamodel suggestions from "Basic" -> "Minimal" and "Advanced" -> "Basic".

For more real-world (aka advanced) examples, please check out the "Reference Implementation" section in the readme: https://github.com/prisma/prisma-examples#reference-implementations

from prisma-examples.

schickling avatar schickling commented on May 17, 2024

Update

I've started updating the examples to the following datamodel:

type Post {
  id: ID! @unique
  createdAt: DateTime!
  updatedAt: DateTime!
  isPublished: Boolean! @default(value: "false")
  title: String!
  content: String!
  author: User!
}

type User {
  id: ID! @unique
  name: String!
  email: String! @unique
  posts: [Post!]!
}

For the GraphQL server examples I suggest the following application schema:

scalar DateTime

type Query {
  feed: [Post!]!
  drafts: [Post!]!
  post(id: ID!): Post
}

type Mutation {
  createDraft(title: String!, content: String!, authorEmail: String!): Post!
  deletePost(id: ID!): Post
  publish(id: ID!): Post
}

type Post {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  isPublished: Boolean!
  title: String!
  content: String!
  author: User!
}

type User {
  id: ID!
  email: String!
  name: String!
  posts: [Post!]!
}

For the xxx-graphql-auth examples, I suggest to add a password: String! field to the User in the datamodel.

from prisma-examples.

abhiaiyer91 avatar abhiaiyer91 commented on May 17, 2024

Great we'll run with this

from prisma-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.