Data Type Error

I am beginning to use Monday API through C#. I am using Monday Client

Here is a sample code which gives a weird error when trying to load details of specific dashboard.

    var dashboardId = <lngid>;

    MondayClient client = new MondayClient("MyAuthKey");
    var b = client.GetBoards().GetAwaiter().GetResult();
    foreach (var item in b)
    {
       if (item.Id == dashboardId)
        {
            var thisBoard = client.GetBoard(item.Id).GetAwaiter().GetResult();
            Console.WriteLine(thisBoard.Name);
        }    
    }

And the error is as below:

Unhandled exception. System.Exception: Type mismatch on variable $id and argument ids ([Int]! / [ID!])
at Monday.Client.MondayClient.ThrowResponseErrors(GraphQLError graphQlErrors) in C:\LavanyaDeepak\projects\monday.client.v2-master\Monday.Client\MondayClient.cs:line 47
at Monday.Client.MondayClient.GetBoard(Int64 boardId) in C:\LavanyaDeepak\projects\monday.client.v2-master\Monday.Client\MondayClient.cs:line 154
at MondayConsumer.Main(String args) in C:\LavanyaDeepak\projects\monday.client.v2-master\Monday.Consumer\Program.cs:line 18

C:\LavanyaDeepak\projects\monday.client.v2-master\Monday.Consumer\bin\Debug\net6.0\Monday.Consumer.exe (process 16704) exited with code -532462766.

hi @lavanyadeepak

Welcome to the community. The error is generated in the function GetBoard and shows that you are sending the boardId in the wrong type. The API expect the boardId of being type ID! and you are apparently sending it as type Int64.

I tried to do a .ToString() however the parameter the library takes is only long. Can you help guide me with a snippet syntax?

Please show your function making the actual API call. I believe that is GetBoard

    public async Task<Board> GetBoard(long boardId)
    {
        var request = new GraphQLRequest
        {
            Query = @"query request($id:Int) { boards(ids:[$id]) { id name description board_kind state board_folder_id permissions owner { id name email url photo_original title birthday country_code location time_zone_identifier phone mobile_phone is_guest is_pending enabled created_at } columns { id, title, type, archived settings_str } } }",
            Variables = new
            {
                id = boardId
            }
        };

        var result = await _graphQlHttpClient.SendQueryAsync<GetBoardsResponse>(request);

        ThrowResponseErrors(result.Errors);

        return result.Data.Boards.FirstOrDefault();
    }

From GitHub - clintmasden/monday.client.v2: A .NET Standard/C# implementation of Monday.com API v2.

This is what I get in Postman:

{
“errors”: [
{
“message”: “Type mismatch on variable $id and argument ids ([Int]! / [ID!])”,
“locations”: [
{
“line”: 1,
“column”: 33
}
],
“path”: [
“query request”,
“boards”,
“ids”
],
“extensions”: {
“code”: “variableMismatch”,
“variableName”: “id”,
“typeName”: “[Int]!”,
“argumentName”: “ids”,
“errorMessage”: “Type mismatch”
}
}
],
“account_id”: 0123456
}

This is where the error originates from, can you change to:

Query = @"query request($id:[ID!])