Initial commit
This commit is contained in:
71
server/src/schema.graphql
Normal file
71
server/src/schema.graphql
Normal file
@@ -0,0 +1,71 @@
|
||||
type Query {
|
||||
info: String!
|
||||
feed(
|
||||
filter: String
|
||||
skip: Int
|
||||
take: Int
|
||||
orderBy: LinkOrderByInput
|
||||
): Feed!
|
||||
}
|
||||
|
||||
type Feed {
|
||||
id: ID!
|
||||
links: [Link!]!
|
||||
count: Int!
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
post(url: String!, description: String!): Link!
|
||||
signup(
|
||||
email: String!
|
||||
password: String!
|
||||
name: String!
|
||||
): AuthPayload
|
||||
login(email: String!, password: String!): AuthPayload
|
||||
vote(linkId: ID!): Vote
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
newLink: Link
|
||||
newVote: Vote
|
||||
}
|
||||
|
||||
type AuthPayload {
|
||||
token: String
|
||||
user: User
|
||||
}
|
||||
|
||||
type User {
|
||||
id: ID!
|
||||
name: String!
|
||||
email: String!
|
||||
links: [Link!]!
|
||||
}
|
||||
|
||||
type Link {
|
||||
id: ID!
|
||||
description: String!
|
||||
url: String!
|
||||
postedBy: User
|
||||
votes: [Vote!]!
|
||||
createdAt: DateTime!
|
||||
}
|
||||
|
||||
type Vote {
|
||||
id: ID!
|
||||
link: Link!
|
||||
user: User!
|
||||
}
|
||||
|
||||
input LinkOrderByInput {
|
||||
description: Sort
|
||||
url: Sort
|
||||
createdAt: Sort
|
||||
}
|
||||
|
||||
enum Sort {
|
||||
asc
|
||||
desc
|
||||
}
|
||||
|
||||
scalar DateTime
|
||||
Reference in New Issue
Block a user