@@ -196,8 +196,6 @@ func (opts *ReportOptions) Run() int {
196196 reportMeta := make (map [string ]string )
197197 reportMeta ["workDir" ] = currentDir
198198
199- query := ReportQuery {Query : reportGraphqlQuery }
200-
201199 queryInput := ReportQueryInput {
202200 AccessToken : dsnAccessToken ,
203201 CommitOID : headCommitOID ,
@@ -209,6 +207,7 @@ func (opts *ReportOptions) Run() int {
209207 Metadata : reportMeta ,
210208 }
211209
210+ query := ReportQuery {Query : reportGraphqlQuery }
212211 query .Variables .Input = queryInput
213212
214213 // Marshal request body
@@ -226,11 +225,27 @@ func (opts *ReportOptions) Run() int {
226225 opts .SkipCertificateVerification ,
227226 )
228227 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+ }
232248 }
233-
234249 // Parse query's response body
235250 queryResponse := QueryResponse {}
236251 err = json .Unmarshal (queryResponseBody , & queryResponse )
0 commit comments