@@ -409,10 +409,9 @@ module internal ProvidedOperation =
409409 then Tracer.runAndMeasureExecutionTime " Ran a multipart GraphQL query request" ( fun _ -> GraphQLClient.sendMultipartRequest context.Connection request)
410410 else Tracer.runAndMeasureExecutionTime " Ran a GraphQL query request" ( fun _ -> GraphQLClient.sendRequest context.Connection request)
411411 let responseString = response.Content.ReadAsStringAsync() .GetAwaiter() .GetResult()
412- let responseJson = Tracer.runAndMeasureExecutionTime " Parsed a GraphQL response to a JsonValue" ( fun _ -> JsonValue.Parse responseString)
413412 // If the user does not provide a context, we should dispose the default one after running the query
414413 if isDefaultContext then ( context :> IDisposable) .Dispose()
415- OperationResultBase( response, responseJson , %% operationFieldsExpr, operationTypeName) @@>
414+ new OperationResultBase( response, responseString , %% operationFieldsExpr, operationTypeName) @@>
416415 let methodParameters = overloadParameters |> List.map ( fun struct ( name , _ , t ) -> ProvidedParameter( name, t, ?optionalValue = if isOption t then Some null else None))
417416 let methodDef = ProvidedMethod( " Run" , methodParameters, operationResultDef, invoker)
418417 methodDef.AddXmlDoc( " Executes the operation on the server and fetch its results." )
@@ -457,17 +456,16 @@ module internal ProvidedOperation =
457456 then Tracer.asyncRunAndMeasureExecutionTime " Ran a multipart GraphQL query request asynchronously" ( fun _ -> GraphQLClient.sendMultipartRequestAsync ct context.Connection request |> Async.AwaitTask)
458457 else Tracer.asyncRunAndMeasureExecutionTime " Ran a GraphQL query request asynchronously" ( fun _ -> GraphQLClient.sendRequestAsync ct context.Connection request |> Async.AwaitTask)
459458 let! responseString = response.Content.ReadAsStringAsync() |> Async.AwaitTask
460- let responseJson = Tracer.runAndMeasureExecutionTime " Parsed a GraphQL response to a JsonValue" ( fun _ -> JsonValue.Parse responseString)
461459 // If the user does not provide a context, we should dispose the default one after running the query
462460 if isDefaultContext then ( context :> IDisposable) .Dispose()
463- return OperationResultBase( response, responseJson , %% operationFieldsExpr, operationTypeName)
461+ return new OperationResultBase( response, responseString , %% operationFieldsExpr, operationTypeName)
464462 } @@>
465463 let methodParameters = overloadParameters |> List.map ( fun struct ( name , _ , t ) -> ProvidedParameter( name, t, ?optionalValue = if isOption t then Some null else None))
466464 let methodDef = ProvidedMethod( " AsyncRun" , methodParameters, TypeMapping.makeAsync operationResultDef, invoker)
467465 methodDef.AddXmlDoc( " Executes the operation asynchronously on the server and fetch its results." )
468466 upcast methodDef)
469467 let parseResultDef =
470- let invoker ( args : Expr list ) = <@@ OperationResultBase(%% args.[ 1 ], JsonValue.Parse %% args.[ 2 ], %% operationFieldsExpr, operationTypeName) @@>
468+ let invoker ( args : Expr list ) = <@@ new OperationResultBase(%% args.[ 1 ], %% args.[ 2 ], %% operationFieldsExpr, operationTypeName) @@>
471469 let parameters = [
472470 ProvidedParameter( " rawResponse" , typeof< HttpResponseMessage>)
473471 ProvidedParameter( " responseJson" , typeof< string>)
0 commit comments