@@ -196,8 +196,6 @@ func (opts *ReportOptions) Run() int {
196
196
reportMeta := make (map [string ]string )
197
197
reportMeta ["workDir" ] = currentDir
198
198
199
- query := ReportQuery {Query : reportGraphqlQuery }
200
-
201
199
queryInput := ReportQueryInput {
202
200
AccessToken : dsnAccessToken ,
203
201
CommitOID : headCommitOID ,
@@ -209,6 +207,7 @@ func (opts *ReportOptions) Run() int {
209
207
Metadata : reportMeta ,
210
208
}
211
209
210
+ query := ReportQuery {Query : reportGraphqlQuery }
212
211
query .Variables .Input = queryInput
213
212
214
213
// Marshal request body
@@ -226,11 +225,27 @@ func (opts *ReportOptions) Run() int {
226
225
opts .SkipCertificateVerification ,
227
226
)
228
227
if err != nil {
229
- fmt .Fprintln (os .Stderr , "DeepSource | Error | Reporting failed |" , err )
230
- sentry .CaptureException (err )
231
- return 1
228
+ // Make Query without message field.
229
+ query := ReportQuery {Query : reportGraphqlQueryOld }
230
+ query .Variables .Input = queryInput
231
+ queryBodyBytes , err := json .Marshal (query )
232
+ if err != nil {
233
+ fmt .Fprintln (os .Stderr , "DeepSource | Error | Unable to marshal query body" )
234
+ sentry .CaptureException (err )
235
+ return 1
236
+ }
237
+ queryResponseBody , err = makeQuery (
238
+ dsnProtocol + "://" + dsnHost + "/graphql/cli/" ,
239
+ queryBodyBytes ,
240
+ "application/json" ,
241
+ opts .SkipCertificateVerification ,
242
+ )
243
+ if err != nil {
244
+ fmt .Fprintln (os .Stderr , "DeepSource | Error | Reporting failed |" , err )
245
+ sentry .CaptureException (err )
246
+ return 1
247
+ }
232
248
}
233
-
234
249
// Parse query's response body
235
250
queryResponse := QueryResponse {}
236
251
err = json .Unmarshal (queryResponseBody , & queryResponse )
0 commit comments