ASP.net core and graphQL

  • Thread starter Thread starter want 2 Learn
  • Start date Start date
W

want 2 Learn

Guest
I have build an asp.net core project which get Rest API calls and return data.

now I added a GraphQL option as well, and I have some issue not clear :

1. when I run the project and go to http://localhost:61171/ui/playground

In my Query and Type class I put a breakpoint which I see something is calling this all the time over and and over.

2. in my Type class I tried to set a Field which returns a List of Data

a. I get an error :

System.ArgumentException: 'The GraphQL type for Field: 'Items' on parent type: 'GetReportType' could not be derived implicitly.

how should i set this field? is it possible to give the client to query only specific properties :

public List<Report> Items { get; set; }


public class Report
{
public string RefID{ get; set; }
public DateTime CreateTime { get; set; }
public string Text { get; set; }
}

3. how can i read a KEY which sent in the HEADER and called "MYKEY"

in the Query class?


thanks for the help

Continue reading...
 
Back
Top