chkimes / graphql-net

Convert GraphQL to IQueryable
MIT License
891 stars 86 forks source link

AddAllFields does not actually add all fields #102

Open mbithy opened 5 years ago

mbithy commented 5 years ago

if I have a class such as

public class Account {
 public int SYSID {
  get;
  set;
 }
 public int AccountTypeSYSID {
  get;
  set;
 }
 public int ProfileSYSID {
  get;
  set;
 }
 public string AccountName {
  get;
  set;
 }
 public double StartingBalance {
  get;
  set;
 }
 public double CurrentBalance {
  get;
  set;
 }
 public Profile Profile() {
  using(var ops = new ProfileDbOps(DbConnection, true)) {
   returnops.GetBySYSID(ProfileSYSID);
  }
 }
}

and try to run the query

{
  account(sysid:12){
    accountTypeSYSID
    accountName
    startingBalance
    currentBalance
    dateCreated
    lastUpdate
    Profile{
      SYSID
      firstName
      middleName
      lastNames
    }
  }
}

you get the exception profile is not a field of type Account but profile is a field on account?!