-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.js
120 lines (107 loc) · 2.56 KB
/
schema.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
const { gql } = require('apollo-server');
const typeDefs = gql`
type Author {
id: ID
name: String
link: String
}
input AuthorInput {
name: String!
}
type AuthorData {
author: Author!
books: [Book]
about: String
influences: String
hometown: String
works_count: String
}
type Groups {
total: String,
groups: [Group!]
}
type Query {
book: Book!
author(name: String): Author!
authorData(id: ID): AuthorData!
bookData(id: ID): Book!
groupsByName(query: String): Groups!
groupData(id: ID): GroupData!
}
type AuthorShort {
id: ID,
name: String,
user_id: String
}
type BookShort {
id: ID!
title: String,
publication_year: String,
author: AuthorShort
}
type Book {
id: ID!
isbn: String
title: String
num_pages: String
description: String
publisher: String
average_rating: String
ratings_count: String
text_reviews_count: String
is_ebook: Boolean
publication_year: String
language_code: String
image_url: String
small_image_url: String
similar_books: [Book]
}
type Group {
id: ID,
title: String,
access: String,
users_count: String,
image_url: String,
small_image_url: String,
last_activity_at: String
}
type Folder {
id: ID,
name: String,
items_count: String,
sub_items_count: String,
updated_at: String
}
type GroupBook {
id: ID!,
updated_at: String,
started_reading_at: String,
finish_reading_at: String
book: BookShort
}
type GroupData {
id: ID,
title: String,
description: String,
display_topics_per_folder: String,
bookshelves_public_flag: [Boolean],
add_books_flag: Boolean,
add_events_flag: Boolean,
polls_flag: Boolean,
discussion_public_flag: Boolean,
real_world_flag: Boolean,
accepting_new_members_flag: Boolean,
category: String,
subcategory: String,
rules: String,
link: String,
image_url: String,
group_users_count: String,
access: String,
last_activity_at: String,
display_folder_count: String,
folders: [Folder],
currently_reading: [GroupBook]
}
`
module.exports = typeDefs;