graphql-client
graphql-client copied to clipboard
Error in a Mutation Execution of 6.0.1 Nuget Version
trafficstars
Hi
internal class WebApiAuthTokenService
{
private static GraphQLHttpClient GraphQLClientForCreateToken;
private readonly string _webApiAddress;
public WebApiAuthTokenService(string WebApiAddress)
{
_webApiAddress = WebApiAddress;
GraphQLClientForCreateToken = new GraphQLHttpClient(_webApiAddress, new NewtonsoftJsonSerializer());
}
public async Task<createTokenResponse> createToken(string login, string Password)
{
var heroRequest = new GraphQLRequest
{
Query = @"mutation createToken {
createToken(login: """ + login + @""", password: """ + Password + @""")
{
token
}
}"
};
var ApiResponse = await GraphQLClientForCreateToken.SendMutationAsync<createTokenResponse>(heroRequest);
return ApiResponse.Data;
}
}
Just by upgrading from version 6.0.0 to version 6.0.1 of the package, the above code starts reporting the exception with the text "The HTTP request failed with status code OK".
Could you please post your createTokenResponse class?
@rose-a
createTokenResponse
internal class createTokenResponse
{
public Createtoken createToken { get; set; }
}
internal class Createtoken
{
public string token { get; set; }
}