graphql / graphql-spec

GraphQL is a query language and execution engine tied to any backend service.
https://spec.graphql.org
14.31k stars 1.13k forks source link

Casting Error in GraphQL C# Library #1064

Closed lavanyadeepak closed 1 year ago

lavanyadeepak commented 1 year ago

We are facing a piquant situation using GraphQLClient's SendQueryAsync method to call Monday.com API. The line goes like this

var response = await graphQLClient.SendQueryAsync(request)

If the server returns a proper JSON it is all fine. However if the server returns a message like Complexity budget exhausted, query cost 30001 budget remaining 29984 out of 1000000 reset in 8 seconds, it throws a message like Error converting value Complexity budget exhausted, query cost 30001 budget remaining 29984 out of 1000000 reset in 8 seconds to type GraphQL.GraphQLError. Path errors[0] line 1 position 305

How do we configure this graphqlclient to cast the string into GraphQL Error or are we missing something else?

benjie commented 1 year ago

Hi @lavanyadeepak, I'm afraid we can't help you with that; you need to raise your issue against the software that you are using (the GraphQL C# Library?).

lavanyadeepak commented 1 year ago

Thank you @benjie . As suggested by you I have posted the same to the C# Library here: https://github.com/graphql-dotnet/graphql-client/issues/600