none
ASP.net core and graphQL RRS feed

  • Question

  • 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

    • Moved by CoolDadTx Monday, June 1, 2020 8:47 PM ASP.NET related
    Monday, June 1, 2020 7:34 PM

All replies