File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 12
12
</PropertyGroup >
13
13
14
14
<ItemGroup >
15
- <PackageReference Include =" HotChocolate.AspNetCore" Version =" 12.3 .1" />
16
- <PackageReference Include =" HotChocolate.Data.EntityFramework" Version =" 12.3 .1" />
17
- <PackageReference Include =" HotChocolate.PersistedQueries.FileSystem" Version =" 12.3 .1" />
15
+ <PackageReference Include =" HotChocolate.AspNetCore" Version =" 12.5.0-preview .1" />
16
+ <PackageReference Include =" HotChocolate.Data.EntityFramework" Version =" 12.5.0-preview .1" />
17
+ <PackageReference Include =" HotChocolate.PersistedQueries.FileSystem" Version =" 12.5.0-preview .1" />
18
18
<PackageReference Include =" Microsoft.EntityFrameworkCore.Sqlite" Version =" 6.0.0" />
19
19
<PackageReference Include =" Microsoft.EntityFrameworkCore.Tools" Version =" 6.0.0" >
20
20
<IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
Original file line number Diff line number Diff line change @@ -17,6 +17,17 @@ namespace ConferencePlanner.GraphQL.Speakers
17
17
[ ExtendObjectType ( typeof ( Speaker ) ) ]
18
18
public class SpeakerNode
19
19
{
20
+ [ BindMember ( nameof ( Speaker . Bio ) , Replace = true ) ]
21
+ public string ? GetBio ( [ Parent ] Speaker speaker , bool error = false )
22
+ {
23
+ if ( error )
24
+ {
25
+ throw new GraphQLException ( "Some error with the bio." ) ;
26
+ }
27
+
28
+ return speaker . Bio ;
29
+ }
30
+
20
31
[ BindMember ( nameof ( Speaker . SessionSpeakers ) , Replace = true ) ]
21
32
public async Task < IEnumerable < Session > > GetSessionsAsync (
22
33
[ Parent ] Speaker speaker ,
@@ -49,7 +60,7 @@ public async IAsyncEnumerable<Session> GetSessionsStreamAsync(
49
60
var random = new Random ( ) ;
50
61
51
62
await Task . Delay ( random . Next ( 500 , 1000 ) , cancellationToken ) ;
52
-
63
+
53
64
await using var context = contextFactory . CreateDbContext ( ) ;
54
65
55
66
var stream = ( IAsyncEnumerable < SessionSpeaker > ) context . Speakers
You can’t perform that action at this time.
0 commit comments