Skip to content

Commit 7746450

Browse files
authored
Add @tag directive to fusion. (#6341)
1 parent 4c2d1db commit 7746450

File tree

45 files changed

+2654
-452
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2654
-452
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,72 @@
11
namespace HotChocolate;
22

3+
/// <summary>
4+
/// Provides well-known directive names.
5+
/// </summary>
36
public static class WellKnownDirectives
47
{
8+
/// <summary>
9+
/// The name of the @skip directive.
10+
/// </summary>
511
public const string Skip = "skip";
12+
13+
/// <summary>
14+
/// The name of the @include directive.
15+
/// </summary>
616
public const string Include = "include";
17+
18+
/// <summary>
19+
/// The name of the @defer directive.
20+
/// </summary>
721
public const string Defer = "defer";
22+
23+
/// <summary>
24+
/// The name of the @stream directive.
25+
/// </summary>
826
public const string Stream = "stream";
27+
28+
/// <summary>
29+
/// The name of the @oneOf directive.
30+
/// </summary>
931
public const string OneOf = "oneOf";
32+
33+
/// <summary>
34+
/// The name of the if directive argument.
35+
/// </summary>
1036
public const string IfArgument = "if";
37+
38+
/// <summary>
39+
/// The name of the label directive argument.
40+
/// </summary>
1141
public const string LabelArgument = "label";
42+
43+
/// <summary>
44+
/// The name of the initialCount directive argument.
45+
/// </summary>
1246
public const string InitialCount = "initialCount";
47+
48+
/// <summary>
49+
/// The name of the @deprecated directive.
50+
/// </summary>
1351
public const string Deprecated = "deprecated";
52+
53+
/// <summary>
54+
/// The name of the deprecated directive argument.
55+
/// </summary>
1456
public const string DeprecationReasonArgument = "reason";
57+
58+
/// <summary>
59+
/// The deprecation default reason.
60+
/// </summary>
1561
public const string DeprecationDefaultReason = "No longer supported.";
62+
63+
/// <summary>
64+
/// The name of the @tag directive.
65+
/// </summary>
66+
public const string Tag = "tag";
67+
68+
/// <summary>
69+
/// The name of the @tag argument name.
70+
/// </summary>
71+
public const string Name = "name";
1672
}

src/HotChocolate/Core/src/Types/Internal/TypeDependencyHelper.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,26 @@ public static void CollectDependencies(
162162
DirectiveTypeDefinition definition,
163163
ICollection<TypeDependency> dependencies)
164164
{
165+
if (definition.HasDependencies)
166+
{
167+
foreach (var dependency in definition.Dependencies)
168+
{
169+
dependencies.Add(dependency);
170+
}
171+
}
172+
165173
if (definition.HasArguments)
166174
{
167175
foreach (var argument in definition.Arguments)
168176
{
177+
if (argument.HasDependencies)
178+
{
179+
foreach (var dependency in argument.Dependencies)
180+
{
181+
dependencies.Add(dependency);
182+
}
183+
}
184+
169185
if (argument.Type is not null)
170186
{
171187
dependencies.Add(new(

0 commit comments

Comments
 (0)