schema.gql 1.27 KB
Newer Older
1 2
schema {
	query: Query
Rafael's avatar
Rafael committed
3
	mutation: Mutation
4 5 6 7 8 9 10 11 12
}

type Query {
	latestTweets: [Tweet]
	notifications: Notifications
	post(slug: String!): Post
	posts(category: String, page: Int): Posts
	popularPosts: [Post!]
}
Rafael's avatar
Rafael committed
13 14 15
type Mutation {
	contact(contactInput: ContactInput!): Contact
}
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74

# Album with photos for the blog
type Album {
	title: String!
	photos: [Photo!]
}

# User that is author of a post
type Author {
	username: String!
}

# Shereland book
type Book {
	title: String
	link: String
}

# Post comment
type Comment {
	name: String
	site: String
	message: String
	createdAt: String
}
type Notifications {
	friendshipRequests: [FriendshipRequest!]
}
type FriendshipRequest {
	slug: String!
	name: String!
}
type Photo {
	thumbnail: String!
	image: String!
	title: String!
	description: String
}
type Post {
	slug: String!
	title: String!
	category: String!
	categorySlug: String!
	content: String!
	publishedAt: String!
	url: String!
	author: Author!
	comments: [Comment!]
	relatedBooks: [Book!]
	relatedPosts: [Post]
	album: Album
}
type Posts {
	currentPage: Int!
	lastPage: Int!
	data: [Post!]
}
type Tweet {
	content: String!
Rafael's avatar
Rafael committed
75 76 77 78 79 80 81 82 83 84 85 86 87 88
}

# Contact
input ContactInput {
	name: String!
	email: String!
	phone: String
	subject: String!
	how_found_site: String!
	message: String!
}
type Contact {
	error: String
}