Michael Staib
{
me {
name
}
}
{
"me": {
"name": "Michael Staib"
}
}
{
me {
name
}
}
{
me {
name
image {
width
height
url
}
}
}
{
"me": {
"name": "Michael Staib",
"image": {
"width": 200,
"height": 300,
"url": "http://some/images/123.png"
}
}
}
{
me {
name
image {
width
height
url
}
}
}
{
me {
name
lastSeen
friends {
name
lastSeen
}
}
}
{
"me": {
"name": "Michael Staib",
"lastSeen": "2018-05-19T18:45",
"friends": [
{
"name": "Rafael Staib",
"lastSeen": "2018-05-24T12:37"
},
{
"name": "Pascal Senn",
"lastSeen": "2018-06-07T17:13"
}
]
}
}
{
me {
name
lastSeen
friends {
name
lastSeen
}
}
}
{
"me": {
"name": "Michael Staib",
"lastSeen": "2018-05-19T18:45",
"friends": [
{
"name": "Rafael Staib",
"lastSeen": "2018-05-24T12:37"
},
{
"name": "Pascal Senn",
"lastSeen": "2018-06-07T17:13"
}
]
}
}
{
me {
... PersonInfo
friends {
... PersonInfo
}
}
}
fragment PersonInfo on Person {
name
lastSeen
}
[UseDbContext(typeof(BookContext))]
[UsePaging]
public IQueryable<Book> GetBooks(
[ScopedService] BookContext context) =>
context.Books;
protected override void Configure(
IObjectTypeDescriptor<Query> descriptor)
{
descriptor
.Field(t => t.GetBooks())
.UseDbContext<BookContext>()
.UsePaging();
}
descriptor.Use(next => async context =>
{
// logic
await next(context);
// more logic
})
https://chillicream.com
https://github.com/chillicream/hotchocolate