public PeopleGraphType(IDataPersons data) { Name = "Peoples"; Description = "Entity that represents the people of an organization"; Field(x => x.Name).Description("Name of person"); Field <ListGraphType <OrganizationGraphType> >("Organizations", resolve: context => { return(data.GetOrganizations().Where(org => org.People.Contains(context.Source.Id))); }); }
public SearchQuery(IDataPersons data) { Name = "Query"; Field <StringGraphType>("Ping", resolve: context => "Ping ok"); Field <ListGraphType <PeopleGraphType> >("People", resolve: context => { return(data.GetPeople()); }); Field <ListGraphType <OrganizationGraphType> >("Organizations", resolve: context => { return(data.GetOrganizations()); }); }