This repository has been archived by the owner on Mar 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cxs.graphql
167 lines (140 loc) · 4.35 KB
/
cxs.graphql
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# EVENT-RELATED TYPES
# ----------------------------------------------------------------------------
# Queries
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Samples
query eventById($id: ID!) {
event(id: $id) {
type
}
}
# Mutations
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Samples
mutation minimalCreateEvent($applicationKey: ApplicationKey!, $newEvent: NewEvent ) {
createEvent(applicationKey: $applicationKey, newEvent: $newEvent) {
id
}
}
mutation detailedCreateEvent($applicationKey: ApplicationKey!, $newEvent: NewEvent ) {
createEvent(applicationKey: $applicationKey, newEvent: $newEvent) {
id
type
client
subject
object
properties
}
}
mutation collectEvent($applicationKey: ApplicationKey!, $newEvents : [NewEvent]) {
collectEvent(applicationKey: $applicationKey, newEvents: $newEvents) {
id
}
}
# PROFILE TYPES
# ----------------------------------------------------------------------------
# Queries
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Samples
query profilesByTopic($topicId : ID!) {
profilesByTopic(topicId: $topicId) {
id
segments
properties
}
}
# CONTEXT TYPES
# ----------------------------------------------------------------------------
# Queries
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Samples
query completeContext($dynamicSegments : [DynamicSegment], $clientProfileId : String) {
context(dynamicSegments : $dynamicSegments, clientProfileId : $clientProfileId) {
profile {
properties(filter: []) {
key
value
}
}
segments {
name
}
dynamicSegments {
name
matched
executionTimeMillis
}
interests {
interest {
id
displayName
}
score
}
}
}
query smallContext($dynamicSegments : [DynamicSegment], $clientProfileId : String) {
context(dynamicSegments : $dynamicSegments, clientProfileId : $clientProfileId) {
profile {
properties(filter : ["email"]) {
value
}
}
}
}
query allSegmentsContext($clientProfileId : String) {
context(clientProfileId : $clientProfileId) {
segments {
name
}
}
}
query contextAllSegmentsIncludingDynamic($dynamicSegments : [DynamicSegment], $clientProfileId : String) {
context(clientProfileId : $clientProfileId, dynamicSegments : $dynamicSegments) {
segments {
name
}
dynamicSegments {
name
matched
}
}
}
# retrieve profile email and last products viewed
query emailAndProductsViewsContext($clientProfileId : String, $eventFilter : Filter) {
context(clientProfileId : $clientProfileId) {
events(filter : $eventFilter) {
timeStamp
object
properties(filter: ["productName", "productSKU", "productDescription"]) {
key
value
}
}
profile {
properties(filter : "email") {
value
}
}
}
}
# Mutations
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Samples
mutation getContext($events: [Event], $dynamicSegments : [DynamicSegment], $clientProfileId : String!) {
getContext(events: $events, dynamicSegments: $dynamicSegments, clientProfileId: $clientProfileId) {
profile
}
}
# INBOUND EVENT TYPES
# ----------------------------------------------------------------------------
# Inbound event could be used to push information from the context server back to a client. An example of an inbound event could
# include resolved locations, resolved client identification (server). Inbound events could be used for real-time personalization
# Subscription samples (pre-defined mutations) :
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
subscription getLastInboundEventProperties($clientProfileId : String!, $filter : Filter) {
inboundEvents(clientProfileId : $clientProfileId, filter: $filter) {
eventType
properties
}
}