I have a service which will now consume a GraphQL API just to return an image URL for a front-end application.
This is my first time using GraphQL at all, and this is the query structure I must use:
var request = new GraphQLRequest
{
Query = @"
query($status: Status = PUBLISHED, $path: String){
brand (status: $status, where: { path: $path }, first: 1){
card {
contentItems {
... on Cartao {
imagemFrente {
urls
}
}
}
}
}
}",
Variables = new
{
path = "[EXAMPLE-PATH]"
}
};
The problem I'm struggling with is how can my class ReturnType must be so I can access the urls property from the request down below?
var graphQLResponse = Task.Run(async () => await graphQLClient.SendQueryAsync<ReturnType>(request));
I'm using the GraphQLClient package only.