public StarWarsQuery(StarWarsDB db) { Field <JediType>( "jedi", arguments: new QueryArguments(new QueryArgument <IntGraphType> { Name = "id" }), resolve: context => db.GetJedis().SingleOrDefault(j => j.Id == context.GetArgument <int>("id"))); Field <ListGraphType <JediType> >( "jedis", resolve: context => db.GetJedis()); }
public Jedi GetJedi(int id) { return(StarWarsDB.GetJedis().SingleOrDefault(j => j.Id == id)); }
public IEnumerable <Jedi> GetJedis() { return(StarWarsDB.GetJedis()); }