Added GQL client + helper methods.
This commit is contained in:
@@ -25,8 +25,8 @@ namespace BodyshopUploader.Utils
|
||||
logger.Trace("Firebase Auth Token {0}.", authlink.FirebaseToken);
|
||||
logger.Trace("Firebase Refresh Token {0}.", authlink.RefreshToken);
|
||||
logger.Trace("Firebase Auth Token expires in {0} seconds.", authlink.ExpiresIn);
|
||||
//tokenTimer.Interval = (authlink.ExpiresIn - 600) * 1000; //Set the token to refresh 10 minutes before it has to.
|
||||
tokenTimer.Interval = 10000; //Set the token to refresh 10 minutes before it has to.
|
||||
tokenTimer.Interval = (authlink.ExpiresIn - 600) * 1000; //Set the token to refresh 10 minutes before it has to.
|
||||
//tokenTimer.Interval = 10000; //Set the token to refresh 10 minutes before it has to.
|
||||
logger.Trace("Refresh timer interval set to {0}ms", (authlink.ExpiresIn - 600) * 1000);
|
||||
tokenTimer.Elapsed += TokenTimer_Tick;
|
||||
tokenTimer.Start();
|
||||
|
||||
19
BodyshopUploader/Utils/GraphQL.cs
Normal file
19
BodyshopUploader/Utils/GraphQL.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using GraphQL.Client;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BodyshopUploader.Utils
|
||||
{
|
||||
public static class GraphQL
|
||||
{
|
||||
public static GraphQLClient CreateGQLClient()
|
||||
{
|
||||
var graphQLClient = new GraphQLClient("https://bodyshop-dev-db.herokuapp.com/v1/graphql");
|
||||
graphQLClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + Utils.Auth.authlink.FirebaseToken);
|
||||
return graphQLClient;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user