This repository was archived by the owner on Dec 9, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
services/graphql-server/src/graphql Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -105,15 +105,19 @@ class GraphQLOperationLogger {
105
105
const variableHash = hashObject ( data . request . variables || { } ) ;
106
106
const variableKeys = objectDeepKeys ( request . variables || { } ) . sort ( ) ;
107
107
108
+ const selectionNames = operation . selectionSet . selections . map ( ( selection ) => ( selection . name ? selection . name . value : '(none)' ) ) ;
109
+
108
110
await Promise . all ( [
109
111
fragments . length ? collection . fragments . bulkWrite ( fragments . map ( ( frag ) => ( {
110
112
updateOne : {
111
113
filter : { _id : frag . hash } ,
112
114
update : {
113
115
$addToSet : {
114
116
clients : client ,
115
- operations : hash ,
116
117
environments : data . request . environment ,
118
+ operations : hash ,
119
+ operationNames : operationName || '(none)' ,
120
+ selections : { $each : selectionNames } ,
117
121
} ,
118
122
$inc : { n : 1 } ,
119
123
$set : { '_meta.lastSeen' : new Date ( ) } ,
@@ -161,7 +165,9 @@ class GraphQLOperationLogger {
161
165
$addToSet : {
162
166
clients : client ,
163
167
operations : hash ,
168
+ operationNames : operationName || '(none)' ,
164
169
environments : data . request . environment ,
170
+ selections : { $each : selectionNames } ,
165
171
} ,
166
172
$inc : { n : 1 } ,
167
173
$set : { '_meta.lastSeen' : new Date ( ) } ,
You can’t perform that action at this time.
0 commit comments