graphql-dotnet / graphql-dotnet/graphql-client

Problem: SendQueryAsync no response

Open
#332 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
648
Forks
136
PR merge metrics
No merged PRs in 30d

Description

### Problem
As the title suggestest i send a graphql request, i do this in 3 different situations but in one of those
the method SendQueryAsync just stops without any errors(tried try catch and breakpoints).

####Details
I have one Class to do this request, i use it mutliple times, but in one case it doesn't work and i have no idea
why, or how to debbug it.

There is nothing noticable in the Stacktrace aswell as far as im concerned

###This is my Code

```C#
using GermanFishing.Model.GraphQLImages;
using GraphQL.Client.Http;
using GraphQL.Client.Serializer.Newtonsoft;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;

namespace GermanFishing.ViewModel
{
public class UserViewModel
{

public User user_profile { get; set; }

public UserViewModel()
{

user_profile = new User();

}

//Consume User Data from Graphql
public async Task GetProfileData()
{
var client = new GraphQLHttpClient(new GraphQLHttpClientOptions
{
EndPoint = new Uri("https://www.german-fishing.de/graphql"),

}, new NewtonsoftJsonSerializer());

client.HttpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + Convert.ToString(Application.Current.Properties["Login"]));

var request = new GraphQLHttpRequest
{
Query = @"
query {
me {
name
unreadNotifications {
data
}
abonnements {
id
place {
id
name
}
}
}
}"
};

var response = await client.SendQueryAsync(request).ConfigureAwait(false);

this.user_profile = response.Data.me;

}

}
}

```
Any suggestions how to approach this ?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.