File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
packages/rum-core/src/domain Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,33 @@ describe('rum assembly', () => {
215215 } )
216216 } )
217217
218+ describe ( 'field resource.graphql on Resource events' , ( ) => {
219+ it ( 'should allow modification of resource.graphql.variables property' , ( ) => {
220+ const { lifeCycle, serverRumEvents } = setupAssemblyTestWithDefaults ( {
221+ partialConfiguration : {
222+ beforeSend : ( event ) => {
223+ if ( event . resource ! . graphql ) {
224+ event . resource ! . graphql . variables = '{"modified":"value"}'
225+ }
226+ } ,
227+ } ,
228+ } )
229+
230+ notifyRawRumEvent ( lifeCycle , {
231+ rawRumEvent : createRawRumEvent ( RumEventType . RESOURCE , {
232+ resource : {
233+ graphql : {
234+ operationType : 'query' ,
235+ variables : '{"original":"value"}' ,
236+ } ,
237+ } ,
238+ } ) ,
239+ } )
240+
241+ expect ( ( serverRumEvents [ 0 ] as RumResourceEvent ) . resource . graphql ! . variables ) . toBe ( '{"modified":"value"}' )
242+ } )
243+ } )
244+
218245 it ( 'should reject modification of field not sensitive, context or customer provided' , ( ) => {
219246 const { lifeCycle, serverRumEvents } = setupAssemblyTestWithDefaults ( {
220247 partialConfiguration : {
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ export function startRumAssembly(
5959 } ,
6060 [ RumEventType . RESOURCE ] : {
6161 'resource.url' : 'string' ,
62+ 'resource.graphql.variables' : 'string' ,
6263 ...USER_CUSTOMIZABLE_FIELD_PATHS ,
6364 ...VIEW_MODIFIABLE_FIELD_PATHS ,
6465 ...ROOT_MODIFIABLE_FIELD_PATHS ,
You can’t perform that action at this time.
0 commit comments