I seem to be struggling with a very simple query that I can’t seem to get to execute without giving me a 500 error.
Below using test query everything executes as normal. When I try to execute a query with quotation marks in the query and use the escape characters the app returns 500 error.
I have tried removing the escape characters and obviously that throws an error. Any insight as to what this issue could be would be much appreciated.
var testQuery = "{\"query\":\" {boards(ids:5146042481) {id}}\"}";
The problem is you are trying to manually serialize your request body.
# warning, I am not a C# guy, so I know C# gets weird about strings. Needing a number of
# $ equal to the number of sequential {{{ for example, and """ three or greater depending
# on how many sequential quotes are inside the string.
var queryString = """{
items_page_by_column_values(
board_id: 5146042481
columns: [{column_id: "name", column_values: "DDNL05"}]
) {
cursor
items {
id
}
}
}""";
var fullQuery = JsonSerializer.Serialize({query: queryString});
Investigate GraphQL Variables because they will make your life much easier trying to substitute the values in your query.
Thank you both for the great suggestions, I have definitely added Postman to my tools. I wanted to give an update. I was able to get a working query this morning using JsonSerializer. with a basic HttpClient.