Updated graphql package and changed insert job query to upsert BOD-198.
This commit is contained in:
@@ -1,22 +1,24 @@
|
||||
using GraphQL.Client;
|
||||
using GraphQL.Common.Request;
|
||||
using GraphQL.Common.Response;
|
||||
using GraphQL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using GraphQL.Client.Http;
|
||||
using GraphQL.Client.Serializer.Newtonsoft;
|
||||
|
||||
namespace BodyshopPartner.Utils
|
||||
{
|
||||
public static class GraphQL
|
||||
{
|
||||
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
||||
|
||||
public static GraphQLClient CreateGQLClient()
|
||||
|
||||
public static GraphQLHttpClient CreateGQLClient()
|
||||
{
|
||||
var graphQLClient = new GraphQLClient("https://bodyshop-dev-db.herokuapp.com/v1/graphql");
|
||||
graphQLClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + Utils.Auth.authlink.FirebaseToken);
|
||||
var graphQLClient = new GraphQLHttpClient("https://bodyshop-dev-db.herokuapp.com/v1/graphql", new NewtonsoftJsonSerializer());
|
||||
|
||||
graphQLClient.HttpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + Utils.Auth.authlink.FirebaseToken);
|
||||
return graphQLClient;
|
||||
}
|
||||
|
||||
@@ -25,9 +27,10 @@ namespace BodyshopPartner.Utils
|
||||
using (var g = Utils.GraphQL.CreateGQLClient())
|
||||
{
|
||||
logger.Trace("Firing GQL Query: {0} {1}", r.Query.ToString(), r.Variables);
|
||||
var graphQLResponse = await g.PostAsync(r);
|
||||
var graphQLResponse = await g.SendQueryAsync<dynamic>(r);
|
||||
if (graphQLResponse.Errors == null)
|
||||
{
|
||||
|
||||
//logger.Trace("GQL Response: {0}", graphQLResponse.Data);
|
||||
return graphQLResponse.Data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user