GraphQL query and C# #1732
-
Not sure if you can answer this. But running the query on Postman returns data, but when I run it in C# it doesn't. Any ideas? ` public static async Task RunAsync()
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Hard to say with the information provided. Can you provide more Info about
|
Beta Was this translation helpful? Give feedback.
-
hi @BumpaRoy, Thank you for the detailed information. Seems like an issue with deserialization from the returned response. Is it possible to check what the raw JSON content response is as returned from the server using your GraphQL.Client? Like @seantleonard asked earlier, do you have any links to which library you are getting Another option is to try executing your GraphQL request as we do in our tests as follows: Thanks! |
Beta Was this translation helpful? Give feedback.
-
I am sorry, but I don't know how to capture the raw json content. The value of the GraphQLClient. Not sure if the screen print helps. As far as the client version it is the latest from gitHub. |
Beta Was this translation helpful? Give feedback.
This seems to be an issue with how
Newtonsoft.Json
deserializes the response into yourRootObject
class, and not something that you need to configure within DAB.Troubleshooting suggestion 1:
I think that your
Data
class needs to change because the GraphQL response propertyproducts
is not a list, it's the name of the GraphQL query you defined in your request:I'm skipping the class
Data
because that class doesn't look to be used in the GraphQL.net library you use for deserializing a GraphQL response into a particular object.More example code that your GraphQL client provides: https://github.com/graphql-dotnet/graphql…