Beispiel #1
0
        public async Task <IActionResult> ApplicationListAsync()
        {
            const string QueryName = "applicationSummaries";
            var          request   = new GraphQlRequest
            {
                Query = $@"
query {{
  {QueryName} {{
    id
    companyName
    status
    date
    description
  }}
}}
"
            };
            GraphQlResponse <JObject> result = await _graphQlService.ExecuteQuery <GraphQlResponse <JObject> >(request);

            var jobApplicationSummaries = result.Data[QueryName]
                                          .ToObject <List <JobApplicationSummary> >();

            return(Ok(jobApplicationSummaries));
        }
Beispiel #2
0
        public async Task <IActionResult> Index([FromBody] GraphQlRequest request)
        {
            var result = await _graphQlService.ExecuteQuery <JObject>(request);

            return(Ok(result));
        }