Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in a Mutation Execution of 6.0.1 Nuget Version #596

Open
victorperez2911 opened this issue Oct 2, 2023 · 2 comments
Open

Error in a Mutation Execution of 6.0.1 Nuget Version #596

victorperez2911 opened this issue Oct 2, 2023 · 2 comments

Comments

@victorperez2911
Copy link

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".

@rose-a
Copy link
Collaborator

rose-a commented Oct 2, 2023

Could you please post your createTokenResponse class?

@victorperez2911
Copy link
Author

victorperez2911 commented Oct 3, 2023

@rose-a

createTokenResponse

internal class createTokenResponse
{
    public Createtoken createToken { get; set; }
}

internal class Createtoken
{
    public string token { get; set; }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants