You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
781 lines
29 KiB
781 lines
29 KiB
using Microsoft.CodeAnalysis.CSharp.Scripting;
|
|
using Microsoft.CodeAnalysis.Scripting;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Linq;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.IO;
|
|
using System.Linq.Expressions;
|
|
using System.Net.Http;
|
|
using System.Net.Http.Headers;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace OnDocScript
|
|
{
|
|
|
|
public class ScriptVars
|
|
{
|
|
public string Variable = "";
|
|
public string RepaceText = "";
|
|
|
|
public ScriptVars(string variable, string replacetext)
|
|
{
|
|
Variable = variable;
|
|
RepaceText = replacetext;
|
|
}
|
|
}
|
|
public class Imports
|
|
{
|
|
public string ImportName = "";
|
|
public string DllName = "";
|
|
|
|
public Imports(string importname, string dllname)
|
|
{
|
|
ImportName = importname;
|
|
DllName = dllname;
|
|
}
|
|
}
|
|
|
|
public class Defaults
|
|
{
|
|
public string Name = "";
|
|
public string Value = "";
|
|
|
|
public Defaults(string name, string value)
|
|
{
|
|
Name = name; Value = value;
|
|
}
|
|
}
|
|
public class NewScript
|
|
{
|
|
public string[] scripts { get; set; }
|
|
public string InputScript { get; set; }
|
|
public string Result { get; set; } = "";
|
|
public string errormessage { get; set; } = "";
|
|
public ScriptState<object> state = null;
|
|
object GraphQLReturn { get; set; }
|
|
public List<ScriptVars> vars = new List<ScriptVars>();
|
|
public List<Imports> Imports = new List<Imports>();
|
|
public List<Defaults> Defaults = new List<Defaults>();
|
|
|
|
public NewScript()
|
|
{
|
|
SetImports();
|
|
}
|
|
public NewScript(string inputscript)
|
|
{
|
|
SetImports();
|
|
|
|
}
|
|
public NewScript(string connectionstring, string inputscript)
|
|
{
|
|
Defaults.Add(new Defaults("Connectionstring", connectionstring));
|
|
SetImports();
|
|
}
|
|
public NewScript(string connectionstring, string ondocapikeyapikey, string inputscript)
|
|
{
|
|
Defaults.Add(new Defaults("Connectionstring", connectionstring));
|
|
Defaults.Add(new Defaults("OnDocAPIKey", ondocapikeyapikey));
|
|
InputScript = inputscript;
|
|
SetImports();
|
|
}
|
|
|
|
public void SetImports()
|
|
{
|
|
Imports.Add(new Imports("System", ""));
|
|
Imports.Add(new Imports("System.Data", ""));
|
|
Imports.Add(new Imports("System.IO", ""));
|
|
Imports.Add(new Imports("System.Net.Http", "System.Net.Http.dll"));
|
|
Imports.Add(new Imports("Newtonsoft.JSON", "Newtonsoft.Json.dll"));
|
|
}
|
|
|
|
public string debugstring = "";
|
|
public Boolean debug = false;
|
|
public class resultdata
|
|
{
|
|
public string name { get; set; }
|
|
public string value { get; set; }
|
|
|
|
public resultdata(string name, string value)
|
|
{
|
|
this.name = name;
|
|
this.value = value;
|
|
}
|
|
}
|
|
bool JSONRes = false;
|
|
List<resultdata> QLRESULTS = new List<resultdata>();
|
|
string qlqueryreslt = "";
|
|
|
|
public void AddVariable(string name, string value)
|
|
{
|
|
vars.Add(new ScriptVars(name, value));
|
|
}
|
|
|
|
string[] StringSplit(string StringToSplit, string Delimitator)
|
|
{
|
|
return StringToSplit.Split(new[] { Delimitator }, StringSplitOptions.None);
|
|
}
|
|
List<string> graphqlres = new List<string>();
|
|
|
|
private string ParseJson(JToken token)
|
|
{
|
|
|
|
switch (token.Type)
|
|
{
|
|
case JTokenType.Object:
|
|
foreach (var property in (JObject)token)
|
|
{
|
|
if (qlqueryreslt.Contains(property.Key)) { QLRESULTS.Add(new resultdata(property.Key.ToString(), property.Value.ToString())); }
|
|
ParseJson(property.Value);
|
|
}
|
|
break;
|
|
|
|
case JTokenType.Array:
|
|
foreach (var item in (JArray)token)
|
|
{
|
|
ParseJson(item);
|
|
}
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
return "";
|
|
}
|
|
public class TableColumns
|
|
{
|
|
public string columnname { get; set; }
|
|
public string columntitle { get; set; }
|
|
public TableColumns(string columnname, string columntitle)
|
|
{
|
|
this.columnname = columnname;
|
|
this.columntitle = columntitle;
|
|
}
|
|
}
|
|
|
|
public async Task Execute()
|
|
{
|
|
string temporärpfad = "";
|
|
foreach (ScriptVars sv in vars)
|
|
{
|
|
|
|
if (sv.Variable.ToUpper() == "TEMPPATH")
|
|
{
|
|
temporärpfad = sv.RepaceText;
|
|
}
|
|
}
|
|
|
|
try
|
|
{
|
|
string[] iscriptlines = StringSplit(InputScript, Environment.NewLine);
|
|
InputScript = "";
|
|
foreach (string line in iscriptlines)
|
|
{
|
|
if (line.Contains("//Scriptvariable"))
|
|
{
|
|
string delimiter = "//Scriptvariable:";
|
|
string[] words = StringSplit(line, delimiter);
|
|
string w = words[1].ToString();
|
|
words = w.Split(';');
|
|
AddVariable(words[0], words[1]);
|
|
}
|
|
else
|
|
{
|
|
if (line.Contains("//debug"))
|
|
{
|
|
debug = true;
|
|
}
|
|
else
|
|
{ InputScript = InputScript + line + Environment.NewLine; }
|
|
}
|
|
|
|
}
|
|
|
|
string temppath = "";
|
|
InputScript = InputScript.Replace("&OnDocScript", "");
|
|
if (!InputScript.Contains("//ScriptPart"))
|
|
{
|
|
scripts = new string[1];
|
|
scripts[0] = InputScript;
|
|
|
|
}
|
|
|
|
|
|
int i1 = 0;
|
|
|
|
|
|
scripts = StringSplit(InputScript, "//ScriptPart");
|
|
foreach (string script in scripts)
|
|
{
|
|
string iscript = script;
|
|
string[] scriptlines = StringSplit(iscript, Environment.NewLine);
|
|
|
|
foreach (string line in scriptlines)
|
|
{
|
|
if (line.Contains("//Name:"))
|
|
{
|
|
string delimiter = "//Name:";
|
|
string[] words = StringSplit(line, delimiter);
|
|
string w = words[1].ToString();
|
|
words = w.Split(';');
|
|
Imports.Add(new Imports(words[0], words[1]));
|
|
|
|
}
|
|
|
|
}
|
|
foreach (ScriptVars sv in vars)
|
|
{
|
|
iscript = iscript.Replace("&&" + @sv.Variable + "&&", sv.RepaceText);
|
|
if (sv.Variable.ToUpper() == "TEMPPATH")
|
|
{
|
|
temppath = sv.RepaceText;
|
|
}
|
|
}
|
|
foreach (Defaults df in Defaults)
|
|
{
|
|
iscript = iscript.Replace("&&" + df.Name + "&&", df.Value);
|
|
}
|
|
var options = ScriptOptions.Default;
|
|
|
|
string[] imports = new string[Imports.Count];
|
|
int cntimportdll = 0;
|
|
int i = 0;
|
|
foreach (Imports import in Imports)
|
|
{
|
|
imports[i] = import.ImportName;
|
|
if (import.DllName.ToString() != "")
|
|
{
|
|
options = options.AddReferences(Assembly.LoadFrom(import.DllName));
|
|
}
|
|
i = i + 1;
|
|
|
|
}
|
|
options.AddImports(imports);
|
|
options.WithImports(imports);
|
|
|
|
if (script.Length > 10)
|
|
{
|
|
if (iscript.Contains("Type:GraphQL"))
|
|
{
|
|
if (temppath == "")
|
|
{
|
|
errormessage = "Temporärer Pfad TempPath wurde nicht angegeben";
|
|
return;
|
|
|
|
}
|
|
if (!System.IO.Directory.Exists(temppath))
|
|
{
|
|
errormessage = "Temporärer Pfad '" + temppath + "' ist nicht vorhanden.";
|
|
return;
|
|
|
|
}
|
|
|
|
int i2 = 0;
|
|
string uri = "";
|
|
string query = "";
|
|
string[] graphgraphlines = StringSplit(iscript, Environment.NewLine);
|
|
foreach (string line in scriptlines)
|
|
{
|
|
if (i2 > 0)
|
|
{
|
|
if (line.Contains("URI="))
|
|
{
|
|
uri = line.Replace("URI=", "");
|
|
}
|
|
else
|
|
{
|
|
if (line.Contains("QUERYResult="))
|
|
{
|
|
qlqueryreslt = line.Replace("QUERYResult=", "");
|
|
}
|
|
else
|
|
{
|
|
query = query + line;
|
|
}
|
|
}
|
|
|
|
}
|
|
query = query.Replace("QUERY=", "");
|
|
query = query.Replace("Type:GraphQL", "");
|
|
foreach (ScriptVars sv in vars)
|
|
{
|
|
query = query.Replace("&&" + @sv.Variable + "&&", sv.RepaceText);
|
|
}
|
|
i2 = i2 + 1;
|
|
}
|
|
if (debug) { debugstring = debugstring + Environment.NewLine + "Graphql:" + Environment.NewLine + uri + Environment.NewLine + query + Environment.NewLine; }
|
|
{
|
|
|
|
}
|
|
OnDocScriptGraphQL.OnDocScriptGraphQL ql = new OnDocScriptGraphQL.OnDocScriptGraphQL();
|
|
try
|
|
{
|
|
await ql.run(uri, query);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
errormessage = ex.Message;
|
|
return;
|
|
};
|
|
// var prettyJson1 = "";
|
|
|
|
// GraphQLReturn = Newtonsoft.Json.JsonConvert.SerializeObject(new { ql.qldata.jsonstring });
|
|
// var arrayOfObjects = JsonConvert.SerializeObject(
|
|
// new[] { JsonConvert.DeserializeObject(ql.qldata.jsonstring), JsonConvert.DeserializeObject("") }
|
|
//);
|
|
string[] cols = qlqueryreslt.Split(',');
|
|
List<TableColumns> columns = new List<TableColumns>();
|
|
DataTable dt = new DataTable();
|
|
|
|
foreach (string col in cols)
|
|
{
|
|
string[] column = col.Split('@');
|
|
if (column.Length > 1)
|
|
{
|
|
columns.Add(new TableColumns(column[0], column[1]));
|
|
}
|
|
else
|
|
{
|
|
columns.Add(new TableColumns(column[0], column[0]));
|
|
}
|
|
if (debug)
|
|
{
|
|
debugstring = debugstring + "Result-Columns Name:" + column[0] + " /" + column[1]+ Environment.NewLine;
|
|
}
|
|
}
|
|
|
|
foreach (TableColumns t in columns)
|
|
{
|
|
dt.Columns.Add(t.columntitle);
|
|
}
|
|
|
|
//foreach (string col in cols)
|
|
//{
|
|
// if (debug)
|
|
// {
|
|
// debugstring = debugstring + "Result-Columns Name:" + col + Environment.NewLine;
|
|
// }
|
|
// dt.Columns.Add(col);
|
|
|
|
//}
|
|
|
|
dynamic data = JObject.Parse(ql.qldata.jsonstring);
|
|
if (debug) { debugstring = debugstring + data.ToString() + Environment.NewLine; }
|
|
ParseJson(data);
|
|
string firstcol = cols[0];
|
|
int ii = 0;
|
|
DataRow dr = dt.NewRow();
|
|
foreach (resultdata item in QLRESULTS)
|
|
{
|
|
if (qlqueryreslt.Contains(item.name))
|
|
{
|
|
if (item.name == columns[0].columnname)
|
|
{
|
|
dr[columns[0].columntitle] = item.value.ToString();
|
|
if (ii > 0)
|
|
{
|
|
dt.Rows.Add(dr);
|
|
dr = dt.NewRow();
|
|
}
|
|
|
|
dr[columns[0].columntitle] = item.value.ToString();
|
|
}
|
|
else
|
|
{
|
|
foreach (TableColumns col in columns)
|
|
{
|
|
if (col.columnname == item.name)
|
|
{
|
|
dr[col.columntitle] = item.value;
|
|
}
|
|
|
|
//dr[item.name] = item.value.ToString();
|
|
}
|
|
}
|
|
ii++;
|
|
}
|
|
|
|
}
|
|
//foreach (resultdata item in QLRESULTS)
|
|
//{
|
|
// if (debug)
|
|
// {
|
|
// debugstring = debugstring + "QLResults: Name:" + item.name + " / value " + item.value + Environment.NewLine;
|
|
// }
|
|
// if (qlqueryreslt.Contains(item.name))
|
|
// {
|
|
// if (item.name == firstcol)
|
|
// {
|
|
// dr[item.name] = item.value.ToString();
|
|
// if (ii > 0)
|
|
// {
|
|
// dt.Rows.Add(dr);
|
|
// dr = dt.NewRow();
|
|
// }
|
|
|
|
// dr[firstcol] = item.value.ToString();
|
|
// }
|
|
// else
|
|
// {
|
|
// dr[item.name] = item.value.ToString();
|
|
// }
|
|
// ii++;
|
|
// }
|
|
|
|
//}
|
|
dt.Rows.Add(dr);
|
|
dt.AcceptChanges();
|
|
DataSet ds = new DataSet();
|
|
ds.Tables.Add(dt.Copy());
|
|
ds.WriteXml(temppath + @"\jsonresult.xml");
|
|
ds = null;
|
|
dt = null;
|
|
|
|
|
|
ql = null;
|
|
|
|
if (scripts.Length == 1) { return; }
|
|
}
|
|
else
|
|
{
|
|
if (i1 == 0)
|
|
|
|
{
|
|
try
|
|
{
|
|
if (debug)
|
|
{
|
|
debugstring = debugstring + "RunAdync: " + iscript + Environment.NewLine;
|
|
}
|
|
state = CSharpScript.RunAsync(iscript, options).Result;
|
|
i1 = 1;
|
|
this.Result = state.ReturnValue.ToString();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
debugstring = debugstring + "Error GraphQL:" + ex.Message + Environment.NewLine;
|
|
errormessage = ex.Message;
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
try
|
|
{
|
|
|
|
try
|
|
{
|
|
iscript = iscript.Replace("&&ReturnValue&&", state.ReturnValue.ToString());
|
|
}
|
|
catch { }
|
|
if (debug)
|
|
{
|
|
debugstring = debugstring + "ContinueWithAsync: " + iscript + Environment.NewLine;
|
|
}
|
|
state = state.ContinueWithAsync(iscript, options).Result;
|
|
this.Result = state.ReturnValue.ToString();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
debugstring = debugstring + "Error Script:" + ex.Message + Environment.NewLine;
|
|
|
|
errormessage = ex.Message;
|
|
return;
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
debugstring = debugstring + "Error Execute:" + ex.Message + Environment.NewLine;
|
|
|
|
errormessage = ex.Message;
|
|
}
|
|
if (debug)
|
|
{
|
|
File.WriteAllText(temporärpfad + @"\scriptdebug.log", debugstring);
|
|
}
|
|
}
|
|
|
|
|
|
public string get_scriptresult()
|
|
{
|
|
return this.Result;
|
|
}
|
|
|
|
}
|
|
public class Script
|
|
{
|
|
public string script = "";
|
|
public List<ScriptVars> vars = new List<ScriptVars>();
|
|
public List<Imports> Imports = new List<Imports>();
|
|
public List<Defaults> Defaults = new List<Defaults>();
|
|
public string resultas = "JSON";
|
|
public object result;
|
|
public int ErrorCode = 0;
|
|
public string Error = "";
|
|
|
|
public Script()
|
|
{
|
|
SetImports();
|
|
|
|
}
|
|
public Script(string inputscript)
|
|
{
|
|
SetImports();
|
|
this.script = inputscript;
|
|
}
|
|
public Script(string connectionstring, string inputscript)
|
|
{
|
|
Defaults.Add(new Defaults("Connectionstring", connectionstring));
|
|
SetImports();
|
|
this.script = inputscript;
|
|
|
|
}
|
|
public Script(string connectionstring, string ondocapikeyapikey, string inputscript)
|
|
{
|
|
Defaults.Add(new Defaults("Connectionstring", connectionstring));
|
|
Defaults.Add(new Defaults("OnDocAPIKey", ondocapikeyapikey));
|
|
this.script = inputscript;
|
|
SetImports();
|
|
}
|
|
|
|
public void SetImports()
|
|
{
|
|
Imports.Add(new Imports("System", ""));
|
|
Imports.Add(new Imports("System.Data", ""));
|
|
Imports.Add(new Imports("System.IO", ""));
|
|
Imports.Add(new Imports("System.Net.Http", "System.Net.Http.dll"));
|
|
Imports.Add(new Imports("Newtonsoft.JSON", "Newtonsoft.Json.dll"));
|
|
}
|
|
|
|
public void AddVariable(string name, string value)
|
|
{
|
|
vars.Add(new ScriptVars(name, value));
|
|
}
|
|
|
|
string[] StringSplit(string StringToSplit, string Delimitator)
|
|
{
|
|
return StringToSplit.Split(new[] { Delimitator }, StringSplitOptions.None);
|
|
}
|
|
public void RunScript()
|
|
{
|
|
string[] scriptlines = StringSplit(script, Environment.NewLine);
|
|
|
|
foreach (string line in scriptlines)
|
|
{
|
|
if (line.Contains("//Name:"))
|
|
{
|
|
string delimiter = "//Name:";
|
|
string[] words = StringSplit(line, delimiter);
|
|
string w = words[1].ToString();
|
|
words = w.Split(';');
|
|
Imports.Add(new Imports(words[0], words[1]));
|
|
}
|
|
}
|
|
ExecuteScript();
|
|
return;
|
|
|
|
|
|
}
|
|
public void ExecuteScript()
|
|
{
|
|
try
|
|
{
|
|
string[] scriptlins = StringSplit(script, Environment.NewLine);
|
|
foreach (string line in scriptlins)
|
|
{
|
|
if (line.Contains("//Name:"))
|
|
{
|
|
string delimiter = "//Name:";
|
|
string[] words = StringSplit(line, delimiter);
|
|
string w = words[1].ToString();
|
|
words = w.Split(';');
|
|
Imports.Add(new Imports(words[0], words[1]));
|
|
|
|
|
|
}
|
|
}
|
|
|
|
foreach (ScriptVars sv in vars)
|
|
{
|
|
script = script.Replace("&&" + @sv.Variable + "&&", sv.RepaceText);
|
|
}
|
|
foreach (Defaults df in Defaults)
|
|
|
|
{
|
|
script = script.Replace("&&" + df.Name + "&&", df.Value);
|
|
}
|
|
|
|
//Imports und ImportOptinen
|
|
var options = ScriptOptions.Default;
|
|
|
|
string[] imports = new string[Imports.Count];
|
|
int cntimportdll = 0;
|
|
int i = 0;
|
|
foreach (Imports import in Imports)
|
|
{
|
|
imports[i] = import.ImportName;
|
|
if (import.DllName.ToString() != "")
|
|
{
|
|
options = options.AddReferences(Assembly.LoadFrom(import.DllName));
|
|
}
|
|
i = i + 1;
|
|
|
|
}
|
|
options.AddImports(imports);
|
|
options.WithImports(imports);
|
|
|
|
|
|
try
|
|
{
|
|
var callresult = CSharpScript.EvaluateAsync(script, options);
|
|
ErrorCode = 0;
|
|
Error = "";
|
|
result = "";
|
|
result = callresult.Result.ToString();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ErrorCode = -2;
|
|
Error = ex.Message;
|
|
result = "";
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ErrorCode = 400;
|
|
Error = ex.Message;
|
|
}
|
|
|
|
}
|
|
private static ScriptState<object> scriptState = null;
|
|
public static object Execute(string code, dynamic scriptOptions)
|
|
{
|
|
scriptState = scriptState == null ? CSharpScript.RunAsync(code).Result : scriptState.ContinueWithAsync(code).Result;
|
|
|
|
if (scriptState.ReturnValue != null && !string.IsNullOrEmpty(scriptState.ReturnValue.ToString()))
|
|
return scriptState.ReturnValue;
|
|
return null;
|
|
}
|
|
|
|
public async Task RunGraphQL(string uri, string query)
|
|
{
|
|
var result = await CallGraphQLAsync(
|
|
new Uri(uri),
|
|
HttpMethod.Post,
|
|
query, null
|
|
//,
|
|
// new
|
|
// {
|
|
// city = "detroit",
|
|
// }
|
|
);
|
|
|
|
}
|
|
|
|
private async Task<string> CallGraphQLAsync(Uri endpoint, HttpMethod method, string query, object variables)
|
|
{
|
|
string url = endpoint.ToString();
|
|
string qur = query;
|
|
var requestBody = new
|
|
{
|
|
query = query
|
|
};
|
|
string jsonContent = Newtonsoft.Json.JsonConvert.SerializeObject(requestBody);
|
|
|
|
using (var client = new HttpClient())
|
|
{
|
|
var content = new StringContent(jsonContent, Encoding.UTF8, "application/json");
|
|
var cts = new CancellationTokenSource();
|
|
cts.CancelAfter(3000); // 3 seconds
|
|
|
|
HttpResponseMessage response = await client.PostAsync(url, content, cts.Token);
|
|
|
|
if (response.IsSuccessStatusCode)
|
|
{
|
|
string result = await response.Content.ReadAsStringAsync();
|
|
return result;
|
|
}
|
|
else
|
|
{
|
|
return ($"Fehler: {response.StatusCode}");
|
|
}
|
|
}
|
|
}
|
|
private async Task<string> CallGraphQLAsync1(Uri endpoint, HttpMethod method, string query, object variables)
|
|
{
|
|
var content = new StringContent(SerializeGraphQLCall(query, variables), Encoding.UTF8, "application/json");
|
|
var httpRequestMessage = new HttpRequestMessage
|
|
{
|
|
Method = method,
|
|
Content = content,
|
|
RequestUri = endpoint,
|
|
};
|
|
//add authorization headers if necessary here
|
|
try
|
|
{
|
|
httpRequestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string a = ex.Message; ;
|
|
}
|
|
try
|
|
{
|
|
|
|
using (var response = await _httpClient.SendAsync(httpRequestMessage).ConfigureAwait(true))
|
|
{
|
|
//if (response.IsSuccessStatusCode)
|
|
if (response?.Content.Headers.ContentType?.MediaType == "application/json")
|
|
{
|
|
var responseString = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
|
|
this.result = responseString;
|
|
this.Error = ""; ;
|
|
this.ErrorCode = 0;
|
|
return responseString;
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
this.result = "";
|
|
this.Error = ""; ;
|
|
this.ErrorCode = 1;
|
|
return ErrorCode.ToString();
|
|
}
|
|
}
|
|
}
|
|
catch (Exception e) { string b = e.Message; return ""; }
|
|
}
|
|
private string SerializeGraphQLCall(string query, object variables)
|
|
{
|
|
var sb = new StringBuilder();
|
|
var textWriter = new StringWriter(sb);
|
|
var serializer = new Newtonsoft.Json.JsonSerializer();
|
|
serializer.Serialize(textWriter, new
|
|
{
|
|
query = query,
|
|
variables = variables,
|
|
});
|
|
return sb.ToString();
|
|
}
|
|
|
|
|
|
|
|
private readonly HttpClient _httpClient = new HttpClient();
|
|
}
|
|
|
|
}
|