-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuery.cs
53 lines (49 loc) · 1.2 KB
/
Query.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System.Security.Claims;
using GraphQL_Test2.Models;
namespace GraphQL_Test2;
public class Query
{
public string GetMe(ClaimsPrincipal claimsPrincipal)
{
var userId = claimsPrincipal.FindFirstValue(ClaimTypes.NameIdentifier);
return userId;
}
public Book GetBook() =>
new Book
{
Title = "C# in depth.",
Author = new Author
{
Name = "Jon Skeet"
}
};
[UsePaging(MaxPageSize = 1, IncludeTotalCount = true)]
public List<Book> GetBooks() =>
new List<Book>
{
new Book
{
Title = "Pride & Prejudice",
Author = new Author
{
Name = "Jane Austin"
}
},
new Book
{
Title = "Paper Towns",
Author = new Author
{
Name = "John Green"
}
},
new Book
{
Title = "C# in depth.",
Author = new Author
{
Name = "Jon Skeet"
}
}
};
}