Last active
November 28, 2018 02:00
-
-
Save benjaminadk/df675b4a79042123df8ca79990cc9d61 to your computer and use it in GitHub Desktop.
chingu7 graphql data model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type User { | |
id: ID! @unique | |
name: String! | |
email: String! @unique | |
image: String | |
password: String # tradition email/password login | |
oauthId: String # if oauth login is used | |
posts: [Post] | |
reviews: [Review] | |
createdAt: DateTime! | |
} | |
type Post { | |
id: ID! @unique | |
langauge: Language! | |
library: Library! | |
contentType: ContentType! | |
difficulty: Difficulty! | |
title: String! # main ui piece the title | |
description: String! # details about the post | |
author: String # company/person who created the content on the web | |
href: String! # link to the actual content | |
image: String # brand logo or image associated with content | |
price: Int! # free would be 0, could use enum here too | |
reviews: [Review] # review about this post, calcuate rating with this | |
user: User! # user who create the post on the site | |
createdAt: DateTime! | |
} | |
type Review { | |
id: ID! @unique | |
rating: Int! # 0 to 5 stars | |
text: String # comment | |
user: User! # use who create review | |
post: Post! # post that is reviewed | |
createdAt: DateTime! | |
} | |
# various programming languages | |
enum Language { | |
JAVASCRIPT | |
PYTHON | |
CPLUSPLUS | |
} | |
# important libraries for included languages | |
enum Library { | |
NATIVE # built into the language | |
REACT | |
SCRAPY | |
ON_POSIX | |
} | |
# general categories of content | |
enum ContentType { | |
DOCUMENTATION | |
TUTORIAL | |
BOOK | |
ARTICLE | |
} | |
# difficulty level of content | |
enum Difficulty { | |
EASY | |
INTERMEDIATE | |
HARD | |
EXPERT | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Model assumes user generated content. There are lots of ways to organize/categorize this data. This is just one way that made sense at the time.