graphql-client icon indicating copy to clipboard operation
graphql-client copied to clipboard

OperationName and Variables Request usage not working !

Open paulmartinjoy opened this issue 4 years ago • 1 comments
trafficstars

I need to use the OperationName and Variables to dynamically pass in arguments. when I am executing the query, I am getting syntax errors. When I debug throught the code, I have found that the query object as an array of 3 objects (query itslef, operationName and Variables) . I am really new to c#. I hope someone can help me to overcome this situation.

paulmartinjoy avatar Jul 19 '21 13:07 paulmartinjoy

var request = new GraphQLRequest{
    Query = "your query string",
    OperationName = "your operation name",
    Variables = new {
        variable1 = "value for variable1",
        variable2 = 1337
    }
}

there's a dedicated constructor accepting those as parameters, too.

rose-a avatar Jul 22 '21 20:07 rose-a