Skip to content

Commit 78ea0c4

Browse files
[Fusion] Return proper subscription type during introspection (#8768)
1 parent d99ac29 commit 78ea0c4

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Execution/Introspection/__Schema.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ public static void MutationType(FieldContext context)
6868

6969
public static void SubscriptionType(FieldContext context)
7070
{
71-
if (context.Schema.MutationType is not null)
71+
if (context.Schema.SubscriptionType is not null)
7272
{
73-
context.AddRuntimeResult(context.Schema.MutationType);
73+
context.AddRuntimeResult(context.Schema.SubscriptionType);
7474
context.FieldResult.SetNextValue(context.RentInitializedObjectResult());
7575
}
7676
}

src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/IntrospectionTests.IntrospectionQueries_IntrospectionQuery.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ request:
2727
}
2828
}
2929
}
30-
30+
3131
fragment FullType on __Type {
3232
kind
3333
name
@@ -61,7 +61,7 @@ request:
6161
... TypeRef
6262
}
6363
}
64-
64+
6565
fragment InputValue on __InputValue {
6666
name
6767
description
@@ -72,7 +72,7 @@ request:
7272
isDeprecated
7373
deprecationReason
7474
}
75-
75+
7676
fragment TypeRef on __Type {
7777
kind
7878
name
@@ -110,7 +110,7 @@ response:
110110
"name": "Mutation"
111111
},
112112
"subscriptionType": {
113-
"name": "Mutation"
113+
"name": "Subscription"
114114
},
115115
"types": [
116116
{
@@ -1707,27 +1707,27 @@ sourceSchemas:
17071707
mutation: Mutation
17081708
subscription: Subscription
17091709
}
1710-
1710+
17111711
interface Node @test(arg: "value") {
17121712
id: ID!
17131713
}
1714-
1714+
17151715
"Interface description"
17161716
interface Votable implements Node {
17171717
"Interface field description"
17181718
id: ID!
17191719
}
1720-
1720+
17211721
type Mutation @test(arg: "value") {
17221722
postReview(input: PostReviewInput): Review @test(arg: "value")
17231723
}
1724-
1724+
17251725
type Post implements Votable & Node @key(fields: "id") {
17261726
id: ID!
17271727
postKind: PostKind @shareable
17281728
location: String @inaccessible
17291729
}
1730-
1730+
17311731
"Object type description"
17321732
type Query @test(arg: "value") {
17331733
"Object field description"
@@ -1737,43 +1737,43 @@ sourceSchemas:
17371737
postById(postId: ID! @is(field: "id")): Post @lookup
17381738
node(id: ID!): Node @lookup
17391739
}
1740-
1740+
17411741
type Review implements Votable & Node @test(arg: "value") {
17421742
id: ID!
17431743
}
1744-
1744+
17451745
type Subscription @test(arg: "value") {
17461746
onNewReview: Review
17471747
}
1748-
1748+
17491749
"Union description"
17501750
union UserCreation @test(arg: "value") = Post | Review
1751-
1751+
17521752
input PostReviewInput @oneOf {
17531753
scalar: String @deprecated(reason: "No longer supported")
17541754
pros: [PostReviewPro]
17551755
}
1756-
1756+
17571757
input PostReviewPro {
17581758
scalar: Int!
17591759
}
1760-
1760+
17611761
"Input object type description"
17621762
input PostsFilter @test(arg: "value") {
17631763
"Input field description"
17641764
scalar: String = "test" @test(arg: "value")
17651765
}
1766-
1766+
17671767
"Enum description"
17681768
enum PostKind @test(arg: "value") {
17691769
"Enum value description"
17701770
STORY @test(arg: "value")
17711771
PHOTO @deprecated(reason: "No longer supported")
17721772
}
1773-
1773+
17741774
"The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object."
17751775
directive @oneOf on INPUT_OBJECT
1776-
1776+
17771777
"Directive description"
17781778
directive @test("Directive argument description" arg: String! = "default") repeatable on QUERY | MUTATION | SUBSCRIPTION | FIELD | FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT | VARIABLE_DEFINITION | SCHEMA | SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
17791779
operationPlan:

0 commit comments

Comments
 (0)