Skip to content

Commit d99ac29

Browse files
authored
[Fusion] Fix __Directive.args resolver (#8764)
1 parent 3e8f73a commit d99ac29

File tree

3 files changed

+55
-22
lines changed

3 files changed

+55
-22
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void OnApplyResolver(string fieldName, IFeatureCollection features)
2727
case "locations":
2828
features.Set(new ResolveFieldValue(Locations));
2929
break;
30-
case "arguments":
30+
case "args":
3131
features.Set(new ResolveFieldValue(Arguments));
3232
break;
3333
}

src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/IntrospectionTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,7 @@ public class Query
519519
private readonly OrderedDictionary<int, Author> _authors =
520520
new OrderedDictionary<int, Author>()
521521
{
522-
[1] = new Author(1, "Jon Skeet"),
523-
[2] = new Author(2, "JRR Tolkien")
522+
[1] = new Author(1, "Jon Skeet"), [2] = new Author(2, "JRR Tolkien")
524523
};
525524

526525
[Internal]

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

Lines changed: 53 additions & 19 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
@@ -1642,7 +1642,24 @@ response:
16421642
"name": "skip",
16431643
"description": "Directs the executor to skip this field or fragment when the \u0060if\u0060 argument is true.",
16441644
"isRepeatable": false,
1645-
"args": null,
1645+
"args": [
1646+
{
1647+
"name": "if",
1648+
"description": "Skips this field or fragment when the condition is true.",
1649+
"type": {
1650+
"kind": "NON_NULL",
1651+
"name": null,
1652+
"ofType": {
1653+
"kind": "SCALAR",
1654+
"name": "Boolean",
1655+
"ofType": null
1656+
}
1657+
},
1658+
"defaultValue": null,
1659+
"isDeprecated": false,
1660+
"deprecationReason": null
1661+
}
1662+
],
16461663
"locations": [
16471664
"FIELD",
16481665
"FRAGMENT_SPREAD",
@@ -1653,7 +1670,24 @@ response:
16531670
"name": "include",
16541671
"description": "Directs the executor to include this field or fragment when the \u0060if\u0060 argument is true.",
16551672
"isRepeatable": false,
1656-
"args": null,
1673+
"args": [
1674+
{
1675+
"name": "if",
1676+
"description": "Includes this field or fragment when the condition is true.",
1677+
"type": {
1678+
"kind": "NON_NULL",
1679+
"name": null,
1680+
"ofType": {
1681+
"kind": "SCALAR",
1682+
"name": "Boolean",
1683+
"ofType": null
1684+
}
1685+
},
1686+
"defaultValue": null,
1687+
"isDeprecated": false,
1688+
"deprecationReason": null
1689+
}
1690+
],
16571691
"locations": [
16581692
"FIELD",
16591693
"FRAGMENT_SPREAD",
@@ -1673,27 +1707,27 @@ sourceSchemas:
16731707
mutation: Mutation
16741708
subscription: Subscription
16751709
}
1676-
1710+
16771711
interface Node @test(arg: "value") {
16781712
id: ID!
16791713
}
1680-
1714+
16811715
"Interface description"
16821716
interface Votable implements Node {
16831717
"Interface field description"
16841718
id: ID!
16851719
}
1686-
1720+
16871721
type Mutation @test(arg: "value") {
16881722
postReview(input: PostReviewInput): Review @test(arg: "value")
16891723
}
1690-
1724+
16911725
type Post implements Votable & Node @key(fields: "id") {
16921726
id: ID!
16931727
postKind: PostKind @shareable
16941728
location: String @inaccessible
16951729
}
1696-
1730+
16971731
"Object type description"
16981732
type Query @test(arg: "value") {
16991733
"Object field description"
@@ -1703,43 +1737,43 @@ sourceSchemas:
17031737
postById(postId: ID! @is(field: "id")): Post @lookup
17041738
node(id: ID!): Node @lookup
17051739
}
1706-
1740+
17071741
type Review implements Votable & Node @test(arg: "value") {
17081742
id: ID!
17091743
}
1710-
1744+
17111745
type Subscription @test(arg: "value") {
17121746
onNewReview: Review
17131747
}
1714-
1748+
17151749
"Union description"
17161750
union UserCreation @test(arg: "value") = Post | Review
1717-
1751+
17181752
input PostReviewInput @oneOf {
17191753
scalar: String @deprecated(reason: "No longer supported")
17201754
pros: [PostReviewPro]
17211755
}
1722-
1756+
17231757
input PostReviewPro {
17241758
scalar: Int!
17251759
}
1726-
1760+
17271761
"Input object type description"
17281762
input PostsFilter @test(arg: "value") {
17291763
"Input field description"
17301764
scalar: String = "test" @test(arg: "value")
17311765
}
1732-
1766+
17331767
"Enum description"
17341768
enum PostKind @test(arg: "value") {
17351769
"Enum value description"
17361770
STORY @test(arg: "value")
17371771
PHOTO @deprecated(reason: "No longer supported")
17381772
}
1739-
1773+
17401774
"The `@oneOf` directive is used within the type system definition language to indicate that an Input Object is a OneOf Input Object."
17411775
directive @oneOf on INPUT_OBJECT
1742-
1776+
17431777
"Directive description"
17441778
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
17451779
operationPlan:

0 commit comments

Comments
 (0)