summaryrefslogtreecommitdiffstats
path: root/backend/src/schema.graphql
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-01-30 12:41:01 -0500
committerWes Bos <wesbos@gmail.com>2018-01-30 12:41:01 -0500
commitcd0b07b3adb36fb5ec098f9e511ab45d774fee7b (patch)
treea203e5010219ccea1acc6bbd2c0a4bcfa0a78615 /backend/src/schema.graphql
parent0a1648bf47490b312169c531aeb51ef4725e8d2e (diff)
Move to Prisma Backend
Diffstat (limited to 'backend/src/schema.graphql')
-rw-r--r--backend/src/schema.graphql36
1 files changed, 36 insertions, 0 deletions
diff --git a/backend/src/schema.graphql b/backend/src/schema.graphql
new file mode 100644
index 0000000..788d490
--- /dev/null
+++ b/backend/src/schema.graphql
@@ -0,0 +1,36 @@
+# import Post, Item, ItemCreateInput from './generated/prisma.graphql'
+
+type Query {
+ feed: [Post!]!
+ drafts: [Post!]!
+ post(id: ID!): Post!
+ me: User
+}
+
+# import Mutation from './generated/prisma.graphql'
+
+type Mutation {
+ signup(email: String!, password: String!, name: String!): AuthPayload!
+ login(email: String!, password: String!): AuthPayload!
+ createDraft(title: String!, text: String!): Post!
+ publish(id: ID!): Post!
+ deletePost(id: ID!): Post!
+ updatePost(id: ID!, title: String, text: String): Post!
+ createItem(data: ItemCreateInput): Item!
+ deleteItem(id: ID!): Item!
+}
+
+type AuthPayload {
+ token: String!
+ user: User!
+}
+
+# THe user definition overrides
+type User {
+ id: ID!
+ email: String!
+ website: String
+ name: String!
+ posts: [Post!]!
+ age: Int
+}