forked from Hganavak/graphql-server-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent-types.js
33 lines (27 loc) · 824 Bytes
/
content-types.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
// Content Type Brainstorm
const { gql } = require('apollo-server');
const TypeDefs = gql`
type ContentItem {
name: String
summary: String
appearsInSearchResults: Boolean # Can do filtering on client?
serviceOwners: Person
copyOwners: Person
userSupport: Person
content: ContentPage # Union type? How does this work with contentful?
}
# Union Type?
union ContentPage = Article | PrivateArticle | MultipageGuide | PrivateMutlipageGuide
`;
const localResolvers = {
Query: {
if (!context.user) {
}
PrivateArticle: (parent, args, context) => {
if (!context.user) return null;
},
PrivateMultipageGuide: (parent, args, context) => {
if (!context.user) return null;
}
}
};