I’m trying to write some vb.net code to call Graphql using httpclient (the postasync call).
This example works:
Dim body As String = “{”“query”“: “”{shop {name} }”“}”
as does:
Dim body As String = “{”“query”“: “”{products(first: 3) {edges {node {id title} } } }”“}”
but I’m struggling with the syntax for extending the set of products return to those which match a product_type, so this:
Dim body As String = “{”“query”“: “”{products(first: 3, query:”“product_type:Fabric”“) {edges {node {id title} } } }”“}”
returns “Bad Request”
the string is being encoded as:
Dim content = New StringContent(body, Encoding.UTF8, “application/json”)
and called as:
Dim response = request.PostAsync(url, content).Result
Any pointers most welcome.