-
Notifications
You must be signed in to change notification settings - Fork 50
Ideas
Steven Kirk edited this page Jan 12, 2018
·
2 revisions
This would be nice:
var query = connection.Query.Repository(owner, name) ...
Might be nice to be able to go:
public class PullRequest
{
public string Number { get; set; }
public string Title { get; set; }
}
var query = new Query().Repository(owner, name).PullRequest(number).Select<PullRequest>()
And have a new PullRequest
created with its members automatically selected and filled.
It would be nice to be able to mock GraphQL queries for unit testing. For that we'd need to create an IConnection
interface. Perhaps one could pass a "tag" to the IConnection.Run
method which would be ignored, but would give mocking frameworks context? Something like:
connection.Run(query, "read-foo");
var connection = Substitute.For<IConnection>();
connection.Run(Arg.Any<IQueryable<Foo>>, "read-foo").Returns(new MockFoo());