-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathschema.js
60 lines (51 loc) · 1.19 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
const { gql } = require('apollo-server-express')
const typeDefs = gql`
type Subscription {
articleEdited: Article
}
type Query {
article(publication: String, slug: String, isRandom: Boolean): Article
sectionArticles(section: String, publication: String): [ArticleMetaData]
author(slug: String): Author
homeArticles(first: Int, section: String, publication: String): [ArticleMetaData]
searchArticles(filter: String, publication: String): [ArticleMetaData]
}
type DominantMedia {
attachment_uuid: String
extension: String
authors: [Author]
}
type Article {
slug: String
headline: String
abstract: String
content: String
published_at: String
dominantMedia: DominantMedia
authors: [Author]
tag: String
}
type ArticleMetaData {
slug: String
headline: String
abstract: String
published_at: String
dominantMedia: DominantMedia
authors: [Author]
tag: String
content: String
}
type ArticleInfo {
edges: [ArticleNode]
hasNextPage: Boolean
}
type ArticleNode {
article: Article
cursor: String
}
type Author {
name: String
slug: String
}
`
module.exports = typeDefs