Comments (6)
All prev data models using the Cat/Master setup is now using this data model
from prisma-examples.
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.
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.
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.
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.
Great we'll run with this
from prisma-examples.
Related Issues (20)
- Update NestJS examples to no longer use beforeExit hook HOT 2
- Improve Next.js Rest API example
- GraphQL next.js example not working
- GraphQL Next.js example missing dependencies
- nuxt 3 prisma example not working on production HOT 1
- nuxtjs3 - db.ts example code does not match the referenced documentation page HOT 1
- nuxtjs3 - rest-nuxtjs example
- how to package prisma
- One-to-many relationship
- tutorial out of date: End-To-End Type-Safety with GraphQL, Prisma & React HOT 2
- Unauthorized Error when Creating a New Post HOT 1
- `typescript/rest-nextjs-express` doesn't work with `try-prisma`
- The domain try-prisma-analytics.com has expired
- Generate types from prisma schema models
- prisma-indexes HOT 1
- MongoDB indexes don't work with `prismagraphql/mongo-single-replica`
- PothosSchemaError: Ref ObjectRef<Profile> has not been implemented HOT 1
- postgresql-supabase instructions missing db seed step
- fix(typescript/trpc-nextjs): typo "singupUser" instead of "signupUser"
- chore(typescript/rest-nestjs): remove unused dependency
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prisma-examples.