When deserializing into a dynamic I can get a response but when I try to deserialize into a typed object I get nothing back.
Types being serialized
public class User {
public string Forename { get; set; }
}
public class UserCollectionResponseType {
public List<User> Items { get; set; }
}
Request being made:
var response = await graphQLHttpClient.SendQueryAsync<UserCollectionResponseType >(this.request).ConfigureAwait(false);
Sample response from API
{
"data": {
"users": {
"items": [
{
"forename": "4212hotp0i"
},
{
"forename": "XO - Test"
},
{
"forename": "5422q5htsd"
},
{
"forename": "XR - Test"
},
{
"forename": "2035snyyex"
},
{
"forename": "2379plsmri"
},
{
"forename": "7100e1igjl"
},
{
"forename": "94 - Test"
},
{
"forename": "ZX - Test"
},
{
"forename": "Test"
}
]
}
}
}
I was missing the
Data
part of the Json when trying to deserialize into an object.My final objects looked like this: