Open ZedZipDev opened 3 years ago
Please post your query string... I suspect you're missing the root data object...
I'm having the same problem here. What do you mean by root data object in the query string @rose-a?
The client deserializes the data
field in the GraphQL response, not the first element mentioned in the query...
a common mistake to make is to forget to wrap the desired object in an object containing an accordingly named field of that type (the ResponseType
in the Readme example).
@rose-a have a similar problem here, if I understand ok, does the client expects a root element "data" from the graphql response from the server?
No matter if I use dynamic object or a object that matches the response, the response.data is always null here, any idea?
public class ApiResult { public string ClientIP { get; set; } public string ExecutionTime { get; set; } public string ServerName { get; set; } public AgentApiResult Result { get; set; } public string StatusCode { get; set; } }
public class AgentApiResult
{
public List<AgentPolicy> agentPolicies { get; set; }
}
public class AgentPolicy
{
public int builderId { get; set; }
public string type { get; set; }
public string level { get; set; }
public List<Market> markets { get; set; }
public List<Division> divisions { get; set; }
public class Market
{
public int id { get; set; }
public string name { get; set; }
}
public class Division
{
public int builderId { get; set; }
public string builderName { get; set; }
}
}
Response looks like this
{ "StatusCode": "Success", "ServerName": "NHSDEVAPI1", "ClientIP": "172.16.2.251", "ExecutionTime": "00:00:00.3523738", "Result": { "agentPolicies": [ { "builderId": 34, "type": "CoOpConfirmation", "level": "Market", "divisions": [ { "builderId": 38 }, { "builderId": 394 }, { "builderId": 396 }, ], "markets": [ { "id": 18 }, { "id": 19 }, { "id": 21 }, ] } ] } }
What if the graphql server defined a different format for the response that this case were in our API
So this server is not compatible with GraphQL official specification.
I run a GraphQL client and send the queries
There is
But in the 1st case var response3 = await client2.SendQueryAsync(request2);
i receive the response3.Data ==null, type ADescriptorResponse2
In other both cases I receive Data correct but it isNewtonsoft.Json.Linq.JObject type.
Why I do not receive the Data of ADescriptorResponse2 filled with data?
What is incorrect?