Skip to content
Steven Kirk edited this page Jan 12, 2018 · 2 revisions

@grokys Ideas

Root query off the connection

This would be nice:

var query = connection.Query.Repository(owner, name) ...

Automatically fill properties of a leaf type

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.

Unit Testing

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());