Esempio n. 1
0
        public async Task Can_Update_Movie()
        {
            var query = new GraphQLHttpRequest
            {
                Query         = Query,
                OperationName = "UpdateMovie",
                Variables     = new
                {
                    movie = new
                    {
                        Id           = new Guid("20DB69D0-7760-4C3F-A484-032423E61018"),
                        Title        = "Sabrina",
                        Description  = "An ugly duckling having undergone a remarkable change, still harbors feelings for her crush: a carefree playboy, but not before his business-focused brother has something to say about it.",
                        Genre        = "romance",
                        YearReleased = 1996,
                    }
                }
            };

            var response = await _graphQlHttpClient.SendMutationAsync <MovieResponseType>(query);

            response.Errors.Should().BeNull();

            // Does not work. For unknown reasons Movie is null.
            // It works in the Playground, though.
            // So it must be a client problem.
            // response.Data.Movie.Should().NotBeNull();
        }
Esempio n. 2
0
        public async Task Can_Create_New_Movie()
        {
            var query = new GraphQLHttpRequest
            {
                Query         = Query,
                OperationName = "CreateMovie",
                Variables     = new
                {
                    movie = new
                    {
                        title        = "Blade Runner",
                        description  = "A blade runner must pursue and terminate four replicants who stole a ship in space, and have returned to Earth to find their creator",
                        yearReleased = 1982,
                        genre        = "scifi"
                    }
                }
            };

            var response = await _graphQlHttpClient.SendMutationAsync <MovieResponseType>(query);

            response.Errors.Should().BeNull();

            // Does not work. For unknown reasons Movie is null.
            // It works in the Playground, though.
            // So it must be a client problem.
            // response.Data.Movie.Should().NotBeNull();
        }
Esempio n. 3
0
        public static async Task <T> ExceuteMutationAsyn <T>(string graphQLQueryType, string completeQueryString)
        {
            try
            {
                var request = new GraphQLRequest
                {
                    Query = completeQueryString
                };

                var response = await graphQLHttpClient.SendMutationAsync <object>(request);

                var stringResult = response.Data.ToString();
                stringResult = stringResult.Replace($"\"{graphQLQueryType}\":", string.Empty);
                stringResult = stringResult.Remove(0, 1);
                stringResult = stringResult.Remove(stringResult.Length - 1, 1);

                var result = JsonConvert.DeserializeObject <T>(stringResult);

                return(result);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        private async void Button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Trim() != "")
            {
                GraphQLRequest request = new GraphQLRequest();
                request.Query = GraphQLQueries.ADD_MOVIE;
                string name    = textBox1.Text.Trim();
                int    year    = Convert.ToInt32(numericUpDown1.Value);
                int    imdb    = Convert.ToInt32(numericUpDown2.Value);
                string subject = textBox2.Text.Trim();
                request.Variables = new { name = name, year = year, imdb = imdb, subject = subject, directorId = id };
                var result = await client.SendMutationAsync(request);

                if (result.Errors != null)
                {
                    MessageBox.Show(result.Errors[0].Message);
                }
                else
                {
                    Movie  movie   = JsonConvert.DeserializeObject <Movie>(result.Data.addMovie.ToString());
                    string movieId = movie.id;
                    int    count   = form1.listView1.Items.Count;
                    form1.listView1.Items.Add(movieId);
                    form1.listView1.Items[count].SubItems.Add(name);
                    form1.listView1.Items[count].SubItems.Add(year.ToString());
                    form1.listView1.Items[count].SubItems.Add(imdb.ToString());
                    form1.listView1.Items[count].SubItems.Add(subject);
                    this.Hide();
                }
            }
        }
Esempio n. 5
0
        public async Task <ActionResult> Create(IFormCollection collection)
        {
            string mutation = $@"
                mutation {{
                    createMovie(inputMovie: {{
                        title: ""{collection["title"]}"",
                        price: {collection["price"]}
                    }})
                    {{
                        id
                        title
                        price
                    }}
                }}
            ";

            GraphQLHttpClient  client  = new GraphQLHttpClient(BackEndConstants.GraphQLUrl, new NewtonsoftJsonSerializer());
            GraphQLHttpRequest request = new GraphQLHttpRequest(mutation);


            try
            {
                await client.SendMutationAsync <Movie>(request);

                return(RedirectToAction(nameof(Index)));
            }
            catch (Exception ex)
            {
                return(View());
            }
        }
        public static async Task <string> ExecuteOperation(int[] range, int target)
        {
            string returnString;

            try
            {
                var client = new GraphQLHttpClient(new GraphQLHttpClientOptions {
                    EndPoint = new Uri(Constants.BackendConstants.GraphQLApiUrl)
                }, new NewtonsoftJsonSerializer());
                var requestString  = "mutation ($input:OperationInput!){combination(input:$input) { }}";
                var operationInput = new
                { input = new {
                      target = target,
                      range  = range
                  } };
                var request = new GraphQLHttpRequest
                {
                    Query     = requestString,
                    Variables = operationInput
                };
                var response = await client.SendMutationAsync <Dictionary <string, int[]> >(request);

                var resultString = response.Data;

                returnString = String.Join(",", resultString["combination"]);
            }
            catch (Exception)
            {
                returnString = "Erro.";
            }
            return(returnString);
        }
        public static async Task UpdateWaitTime(string rideId, string waitTime)
        {
            try
            {
                var updateRequest = new GraphQLRequest
                {
                    Query = @"mutation updateWaitTime($rideId: String, $waitTime: String) {
                            update_rides(where: {id:{_eq: $rideId}}, _set: {waitTime:$waitTime}) {
                                returning {
                                    name
                                    waitTime
                                }
                            }
                        }",

                    Variables = new
                    {
                        rideId   = rideId,
                        waitTime = waitTime
                    }
                };


                await _graphQLClient.SendMutationAsync <dynamic>(updateRequest);
            }catch (Exception ex)
            {
                Thread.Sleep(2000);
            }
        }
Esempio n. 8
0
        protected override async Task OnInitializedAsync()
        {
            var uri = new Uri(NavigationManager.BaseUri + "graphql");

            var graphQLClient = new GraphQLHttpClient(uri, new SystemTextJsonSerializer());

            var heroRequest = new GraphQLRequest
            {
                Query     = @"mutation($credentials:LoginInput!){
  login(credentials: $credentials){
    id
    username
  }
}",
                Variables = new
                {
                    credentials = new
                    {
                        username = "******",
                        password = "******"
                    }
                }
            };

            var graphQLResponse = await graphQLClient.SendMutationAsync(heroRequest, () => new { userLogin = new User() });

            var personName = graphQLResponse.Data?.userLogin;

            var options = new JsonSerializerOptions
            {
                WriteIndented = true
            };

            _graphQlJson = JsonSerializer.Serialize(personName, options);
        }
Esempio n. 9
0
        public async Task <dynamic> ExecuteMutationAsync(string query, Dictionary <string, object> args)
        {
            try
            {
                if (_client == null)
                {
                    _client = new GraphQLHttpClient(_endPointUrl);
                }

                //turn args into anonymous object
                dynamic eo = args.Aggregate(new ExpandoObject() as IDictionary <string, Object>, (a, p) => { a.Add(p.Key, p.Value); return(a); });

                var assentRequest = new GraphQLRequest()
                {
                    Query     = query,
                    Variables = eo
                };

                //check query string
                //var graphQLString = JsonConvert.SerializeObject(assentRequest, _client.Options.JsonSerializerSettings);

                var graphQLResponse = await _client.SendMutationAsync(assentRequest);// SendQueryAsync(assentRequest);

                return(graphQLResponse.Data);
            }
            catch (Exception ex)
            {
                return(ex);
            }
        }
        private async void Button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Trim() != null)
            {
                GraphQLRequest request = new GraphQLRequest();
                request.Query = GraphQLQueries.ADD_DIRECTOR;
                string name  = textBox1.Text.Trim();
                int    birth = Convert.ToInt32(numericUpDown1.Value);
                request.Variables = new { name = name, birth = birth };
                var result = await client.SendMutationAsync(request);

                if (result.Errors != null)
                {
                    MessageBox.Show(result.Errors[0].Message);
                }
                else
                {
                    Director director = JsonConvert.DeserializeObject <Director>(result.Data.addDirector.ToString());
                    string   id       = director.id;
                    int      count    = form1.listView2.Items.Count;
                    form1.listView2.Items.Add(id);
                    form1.listView2.Items[count].SubItems.Add(name);
                    form1.listView2.Items[count].SubItems.Add(birth.ToString());
                    this.Hide();
                }
            }
        }
Esempio n. 11
0
        public async static Task CreateOrderMutation()
        {
            using (var graphQLClient = new GraphQLHttpClient("https://*****:*****@"mutation ($order:OrderDetailInputType!) {
                            createOrder(orderDetail:$order) {
                                id
                                orderStatus
                                addressLine1
                                addressLine2
                                pizzaDetails {
                                    id
                                    toppings
                                }
                            }
                        }",
                    Variables = new
                    {
                        order = new
                        {
                            addressLine1 = "ICH" + DateTime.Now,
                            addressLine2 = "Brasilia" + DateTime.Now,
                            mobileNo     = "999",
                            amount       = 500,
                            pizzaDetails = new[]
                            {
                                new
                                {
                                    name     = "Randel's pizza" + DateTime.Now,
                                    price    = 10,
                                    size     = 5,
                                    toppings = Toppings.ExtraCheese
                                }
                            }
                        }
                    }
                };

                var response = await graphQLClient.SendMutationAsync <CreateOrderResponse>(createOrderMutation);

                Console.WriteLine();
                Console.WriteLine($"{nameof(CreateOrderDetail.Id)}: {response.Data.CreateOrder.Id}");
                Console.WriteLine($"{nameof(CreateOrderDetail.AddressLine1)}: {response.Data.CreateOrder.AddressLine1}");
                Console.WriteLine($"{nameof(CreateOrderDetail.AddressLine2)}: {response.Data.CreateOrder.AddressLine2}");
                Console.WriteLine($"{nameof(CreateOrderDetail.OrderStatus)}: {response.Data.CreateOrder.OrderStatus}");
                foreach (var item in response.Data.CreateOrder.PizzaDetails)
                {
                    Console.WriteLine("~~~~~~~~~~~~~~~~~~~~");
                    Console.WriteLine();
                    Console.WriteLine($"{nameof(Pizzadetail.Id)}: {item.Id}");
                    Console.WriteLine($"{nameof(Pizzadetail.Toppings)}: {item.Toppings}");
                    Console.WriteLine();
                    Console.WriteLine("~~~~~~~~~~~~~~~~~~~~");
                }
            }
        }
Esempio n. 12
0
        public async Task <TK> SendMutationAsync <TK>(string schemaName, string mutationName, GraphQLRequest request) where TK : class
        {
            var response = await m_client.SendMutationAsync(request);

            response.Data = response.Data[schemaName];
            var result = response.GetDataFieldAs <TK>(mutationName);

            return(result);
        }
Esempio n. 13
0
        private async Task <T> SendMutation <T>(string accessToken, string query)
        {
            if (!_client.HttpClient.DefaultRequestHeaders.Contains("Authorization"))
            {
                _client.HttpClient.DefaultRequestHeaders.Add("Authorization", accessToken);
            }
            var response = await _client.SendMutationAsync <T>(new GraphQLRequest(query));

            return(response.Data);
        }
Esempio n. 14
0
        public async Task <bool> ToggleFavorite(string productId)
        {
            var graphQlRequest = new GraphQLRequest()
            {
                Query     = Mutations.ToggleFavorite,
                Variables = new { productId }
            };

            var response = await m_client.SendMutationAsync(graphQlRequest, () => new { makeFavorite = false });

            return(response.Data.makeFavorite);
        }
Esempio n. 15
0
        public async Task <GraphQLResponse <RetornoLogin> > Login(string email, string password)
        {
            var login = new GraphQLRequest
            {
                Query     = @"
                mutation ($input: LoginMutationInput!) {
                    login(input: $input) {
                        user {
                            apiKey
                        }
                    }
                }",
                Variables = new
                {
                    input = new
                    {
                        email,
                        password
                    }
                }
            };

            var graphQLResponse = await _client.SendMutationAsync <RetornoLogin>(login);

            if (graphQLResponse.Data.Login.User == null)
            {
                throw new Exception("Não foi possivel efetuar o login na loggi");
            }


            _apiToken = graphQLResponse.Data.Login.User.ApiKey;
            _email    = email;

            IsLogged = true;

            _client.HttpClient.DefaultRequestHeaders.Add("Authorization", String.Format("ApiKey {0}:{1}", _email, _apiToken));

            return(graphQLResponse);
        }
Esempio n. 16
0
        //public static async Task<GraphQLResponse<dynamic>> CreateAnswer(this GraphQLHttpClient client, CreateAnswerCmd cmd)
        //{
        //    const string query =
        //        @"mutation createAnswer($cmd: CreateAnswerCmd!){
        //            createAnswer(cmd: $cmd){
        //                successful
        //                answerId
        //                failureText
        //            }
        //        }";

        //    var request = new GraphQLRequest(query, new Dictionary<string, object>()
        //    {
        //        {"cmd", cmd}
        //    });

        //    return await client.SendMutationAsync<dynamic>(request);
        //}

        public static async Task <GraphQLResponse <dynamic> > VoteUp(this GraphQLHttpClient client, VoteUpCmd cmd)
        {
            const string query =
                @"mutation voteUp($cmd: VoteUpCmd!){
                    voteUp(cmd: $cmd){
                        successful
                        failureText
                    }
                }";

            var request = new GraphQLRequest(query, new Dictionary <string, object>()
            {
                { "cmd", cmd }
            });

            return(await client.SendMutationAsync <dynamic>(request));
        }
        public async Task <TValue> ExecuteMutation <TValue>(string query, object variables = null)
        {
            var byteArray = Encoding.ASCII.GetBytes($"{apiKey}:{apiPassword}");

            _graphClient.HttpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));

            var request = new GraphQLRequest()
            {
                Query = query
            };

            request.Variables = variables ?? null;

            var response = await _graphClient.SendMutationAsync <TValue>(request);

            return(response.Data);
        }
        public async Task <ProductReviewModel> AddReview(ProductReviewModelInput review)
        {
            var client = new GraphQLHttpClient(httpsLocalhostGraphql, new SystemTextJsonSerializer());
            var query  = new GraphQLHttpRequest
            {
                Query     = @" 
                mutation($review: reviewInput!)
                {
                    createReview(review: $review)
                    {
                        id title
                    }
                }",
                Variables = new { review }
            };
            var response = await client.SendMutationAsync <ProductReviewResponse>(query);

            return(response.Data.CreateReview);
        }
Esempio n. 19
0
        public async Task <Guid> AddReviewAsync(ReviewModel review, CancellationToken cancellationToken = default)
        {
            var request = new GraphQLRequest
            {
                Query     = @"mutation($review: reviewInput!) {
                              createReview(review: $review) {
                                id
                              }
                            }",
                Variables = new { review }
            };

            var response = await _client.SendMutationAsync(
                request: request,
                defineResponseType : () => new { createReview = new { id = new Guid() } },
                cancellationToken : cancellationToken);

            return(response.Errors?.Any() ?? default ? default : response.Data.createReview.id);
        }
        public async Task <MutationRunStats> RunAsync()
        {
            var result = new MutationRunStats();

            var payload = CreatePayload();

            result.PayloadSizeInKb = Encoding.UTF8.GetByteCount(payload) / (double)1024;
            result.Start           = DateTime.UtcNow;

            var response = await _client.SendMutationAsync <object>(new GraphQLRequest
            {
                Query = payload
            });

            result.Errors = response.Errors;
            result.End    = DateTime.UtcNow;

            return(result);
        }
Esempio n. 21
0
        public static async Task <GraphQLResponse <dynamic> > CreateTenantAndAdmin(this GraphQLHttpClient client, CreateTenantCmd createTenantCmd)
        {
            const string query =
                @"mutation createTenant($cmd: CreateTenantCmd!) {
                      createTenant(cmd: $cmd) {
                        successful 
                        tenantId
                        adminName
                      }
                }";

            var request = new GraphQLRequest(query, new Dictionary <string, object>()
            {
                { "cmd", createTenantCmd }
            });

            var result = await client.SendMutationAsync <dynamic>(request);

            Assert.IsNull(result.Errors);

            return(result);
        }
Esempio n. 22
0
        public async Task <Product> Get(int productId)
        {
            var query = new GraphQLHttpRequest
            {
                Query     = @"
                    query product($productId: ID!)
                    {
                        product(id: $productId)
                        {
                            id
                            name
                            description
                        }
                    }
                ",
                Variables = new { productId }
            };

            var response = await _client.SendMutationAsync <ProductContainer>(query);

            return(response.Data.Product);
        }
Esempio n. 23
0
        public async void SendMutationFact()
        {
            var mutationRequest = new GraphQLRequest(@"
				mutation CreateHuman($human: HumanInput!) {
				  createHuman(human: $human) {
				    id
				    name
				    homePlanet
				  }
				}"                ,
                                                     new { human = new { name = "Han Solo", homePlanet = "Corellia" } });

            var queryRequest = new GraphQLRequest(@"
				query Human($id: String!){
					human(id: $id) {
						name
					}
				}"                );

            var mutationResponse = await StarWarsClient.SendMutationAsync(mutationRequest, () => new
            {
                createHuman = new
                {
                    Id         = "",
                    Name       = "",
                    HomePlanet = ""
                }
            });

            Assert.Null(mutationResponse.Errors);
            Assert.Equal("Han Solo", mutationResponse.Data.createHuman.Name);
            Assert.Equal("Corellia", mutationResponse.Data.createHuman.HomePlanet);

            queryRequest.Variables = new { id = mutationResponse.Data.createHuman.Id };
            var queryResponse = await StarWarsClient.SendQueryAsync(queryRequest, () => new { Human = new { Name = string.Empty } });

            Assert.Null(queryResponse.Errors);
            Assert.Equal("Han Solo", queryResponse.Data.Human.Name);
        }
        public override async Task <int> ExecuteAsync()
        {
            if (_options.Labels?.Count() == 0)
            {
                throw new InvalidOperationException("No label(s) specified");
            }

            var graphClient = new GraphQLHttpClient("https://api.github.com/graphql", new NewtonsoftJsonSerializer());

            graphClient.HttpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {_options.GitHubPat}");
            graphClient.HttpClient.DefaultRequestHeaders.Add("User-Agent", "arsub/0.1");

            var issuesToSubscribeVariables = new IssuesToSubscribeVariables
            {
                query = $"is:issue state:open {IncludingLabelsFilter()} repo:{_options.Repo} {DateRangeFilter()}",
                after = (string)null,
            };
            var issuesToSubscribeRequest = new GraphQLRequest
            {
                Query         = @"
                query IssuesToSubscribe($query:String!, $after:String) {
                  search(query: $query, type: ISSUE, first: 100, after: $after) {
                    nodes {
                      ... on Issue {
                        __typename
                        id
                        number
                        title
                        updatedAt
                        url
                        labels(first: 100) {
                          nodes {
                            name
                          }
                        }
                      }
                    }
                    pageInfo {
                      endCursor
                      hasNextPage
                    }
                    issueCount
                  }
                }",
                OperationName = "IssuesToSubscribe",
                Variables     = issuesToSubscribeVariables,
            };

            var subscribeToIssueMutation = new GraphQLRequest
            {
                Query         = @"
                mutation SubscribeToIssue($issue:String!, $state:SubscriptionState!) {
                  __typename
                  updateSubscription(input: {state: $state, subscribableId: $issue}) {
                    clientMutationId
                  }
                }",
                OperationName = "SubscribeToIssue"
            };

            int  countSubscribed = 0;
            bool nextPage        = true;

            while (nextPage)
            {
                Logger.LogDebug($"GraphQL query to {graphClient.HttpClient.BaseAddress} with query:{issuesToSubscribeRequest.Query}\nusing variables:\n{JsonConvert.SerializeObject(issuesToSubscribeRequest.Variables, Formatting.Indented)}");
                var issuesQueryResult = await graphClient.SendQueryAsync <dynamic>(issuesToSubscribeRequest);

                if (issuesQueryResult.Errors?.Any() == true)
                {
                    Logger.LogError($"GraphQL query errors: {JsonConvert.SerializeObject(issuesQueryResult.Errors, Formatting.Indented)}");
                    return(Constants.ErrorCode);
                }
                Logger.LogDebug($"GraphQL query result: \n{JsonConvert.SerializeObject(issuesQueryResult.Data, Formatting.Indented)}");

                dynamic data = issuesQueryResult.Data;

                foreach (dynamic issue in data.search.nodes)
                {
                    // TODO: test if already subscribed by events and ignore if unsubscribed afer it have received that label

                    subscribeToIssueMutation.Variables = new
                    {
                        issue = issue.id,
                        state = SubscriptionStatusStrategy,
                    };

                    Logger.LogDebug($"GraphQL mutation {graphClient.HttpClient.BaseAddress} with mutation:{subscribeToIssueMutation.Query}\nusing variables:\n{JsonConvert.SerializeObject(subscribeToIssueMutation.Variables, Formatting.Indented)}");
                    if (!_options.WhatIf)
                    {
                        var mutation = await graphClient.SendMutationAsync <dynamic>(subscribeToIssueMutation);

                        if (mutation.Errors?.Any() != true)
                        {
                            Logger.LogDebug($"GraphQL query mutation result: \n{JsonConvert.SerializeObject(mutation, Formatting.Indented)}");
                        }
                        else
                        {
                            Logger.LogError($"GraphQL mutation errors: {JsonConvert.SerializeObject(mutation.Errors, Formatting.Indented)}");
                            return(Constants.ErrorCode);
                            // TODO: retry?
                        }
                    }
                    countSubscribed++;
                    Console.WriteLine($"{issue.url} => {issue.title}");
                }

                if (issuesQueryResult.Errors?.Any() != true && data.search.pageInfo.hasNextPage == true)
                {
                    issuesToSubscribeVariables.after = (string)data.search.pageInfo.endCursor;
                }
                else
                {
                    nextPage = false;
                }
            }

            if (countSubscribed > 0)
            {
                Console.WriteLine($"Succesfully changed subscription to {countSubscribed} issues");
            }
            else
            {
                Console.WriteLine($"No issue found!");
            }

            return(Constants.SuccessCode);
        }
Esempio n. 25
0
        static async Task Main(string[] args)
        {
            Console.WriteLine("configuring client ...");
            using (var client = new GraphQLHttpClient("http://*****:*****@"
							mutation($input: MessageInputType){
							  addMessage(message: $input){
								content
							  }
							}"                            )
                        {
                            Variables = new
                            {
                                input = new
                                {
                                    fromId  = "2",
                                    content = message,
                                    sentAt  = DateTime.Now
                                }
                            }
                        };
                        var result = await client.SendMutationAsync(graphQLRequest).ConfigureAwait(false);

                        if (result.Errors != null && result.Errors.Length > 0)
                        {
                            Console.WriteLine($"request returned {result.Errors.Length} errors:");
                            foreach (var item in result.Errors)
                            {
                                Console.WriteLine($"{item.Message}");
                            }
                        }
                    }while(!quit);
                    Console.WriteLine("shutting down ...");
                }
                Console.WriteLine("subscriptions disposed ...");
            }
            Console.WriteLine("client disposed ...");
        }
        static async Task Main(string[] args)
        {
            var graphQLClient = new GraphQLHttpClient("https://*****:*****@"query {
    newOrders {
        addressLine1
        addressLine2
        amount
    }
}";

            var newOrderResponse = await graphQLClient.SendQueryAsync(newOrdersQuery);

            List <NewOrderDetails> newOrderDetails = newOrderResponse.GetDataFieldAs <List <NewOrderDetails> >("newOrders");

            #endregion

            string createOrderMutation = @"mutation ($order:OrderDetailsInputType!) {
  createOrder(orderDetails:$order)
  {
    id
    orderStatus
    addressLine1
    addressLine2
    pizzaDetails
    {
      id
      toppings
    }
  }
}";

            GraphQLRequest createOrderRequest = new GraphQLRequest
            {
                Query     = createOrderMutation,
                Variables = new
                {
                    order = new
                    {
                        addressLine1 = "1 Address Line",
                        addressLine2 = "2 Address Line",
                        mobileNo     = "0123456789",
                        amount       = 500,
                        pizzaDetails = new[] {
                            new {
                                name     = "My Nilay Pizza",
                                price    = 10,
                                size     = 5,
                                toppings = "EXTRA_CHEESE"
                            }
                        }
                    }
                }
            };

            var createOrderResponse = await graphQLClient.SendMutationAsync(createOrderRequest);

            CreateOrderDetails orderDetails = createOrderResponse.GetDataFieldAs <CreateOrderDetails>("createOrder");
        }
 public async Task <GraphQLResponse <TResponse> > SendMutationAsync <TResponse>(IRequest request, CancellationToken token = default)
 {
     request.EnsureNotNull();
     return(await _client.SendMutationAsync <TResponse>(GraphQLRequestFactory.Create(request.Query, request.OperationName, request.Variables), token).ConfigureAwait(true));
 }