Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composition Improvements #6667

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fff004a
Started adding resolve directive.
michaelstaib Sep 9, 2023
9bfe9fe
more edits
michaelstaib Sep 10, 2023
5431238
Merge branch 'main' into mst/fusion-resolve-directive
michaelstaib Sep 12, 2023
3dbb5ef
Merge branch 'main' into mst/fusion-resolve-directive
michaelstaib Sep 22, 2023
53aca9d
edits
michaelstaib Sep 23, 2023
54f2d56
FusionTypes Refactoring
michaelstaib Oct 10, 2023
48711b9
edits
michaelstaib Oct 13, 2023
ac8a20b
edits
michaelstaib Oct 14, 2023
5448865
edits
michaelstaib Oct 15, 2023
5d53557
edits
michaelstaib Oct 15, 2023
295bc1f
edits
michaelstaib Oct 17, 2023
53fa6c5
edits
michaelstaib Oct 18, 2023
e3e625d
edits
michaelstaib Oct 18, 2023
2bbf817
Merge branch 'main' into mst/fusion-resolve-directive
michaelstaib Oct 24, 2023
a2b996a
restore
michaelstaib Oct 24, 2023
17312e5
merge
michaelstaib Oct 26, 2023
f35de4a
merge
michaelstaib Oct 26, 2023
4a6c404
edits
michaelstaib Oct 27, 2023
70013cd
edits
michaelstaib Oct 27, 2023
0cdcf85
edits
michaelstaib Oct 28, 2023
27e0a2b
edits
michaelstaib Oct 28, 2023
3c6d424
edits
michaelstaib Nov 1, 2023
898b626
Merge branch 'main' into mst/fusion-resolve-directive
michaelstaib Nov 2, 2023
3a77e26
Merge branch 'main' into mst/fusion-resolve-directive
michaelstaib Nov 3, 2023
1e67044
Merge branch 'main' into mst/fusion-resolve-directive
michaelstaib Nov 5, 2023
d152742
Added variables
michaelstaib Nov 9, 2023
4229d8c
Implemented first part of the entity resolvers
michaelstaib Nov 10, 2023
2439858
More Tests
michaelstaib Nov 13, 2023
d525eeb
Added Private Support
michaelstaib Nov 15, 2023
609462f
Added simple by name bindings
michaelstaib Nov 15, 2023
392ea27
Merge branch 'main' into mst/fusion-resolve-directive
michaelstaib Nov 16, 2023
a2da93b
edits
michaelstaib Nov 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ public static void MatchInlineSnapshot(
string snapshot,
ISnapshotValueFormatter? formatter = null)
=> Snapshot.Create().Add(value, formatter: formatter).MatchInline(snapshot);

public static async Task MatchInlineSnapshotAsync<T>(
this Task<T> value,
string snapshot,
ISnapshotValueFormatter? formatter = null)
=> Snapshot.Create().Add(await value, formatter: formatter).MatchInline(snapshot);

public static void MatchSnapshot(this Snapshot value)
=> value.Match();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ namespace HotChocolate.Types;
/// This marker interface identifies member of the type system like
/// types, directives, the schema or fields and arguments.
/// </summary>
public interface ITypeSystemMember { }
public interface ITypeSystemMember;
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ public sealed class InstrumentationOptions
/// Specifies if the parsed document shall be included into the tracing data.
/// </summary>
public bool IncludeDocument { get; set; }



/// <summary>
/// Specifies if DataLoader batch keys shall included into the tracing data.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,30 @@ namespace HotChocolate.Fusion;
/// </summary>
internal static class FusionDirectiveArgumentNames
{
/// <summary>
/// Gets the name of the variable argument.
/// </summary>
public const string VariableArg = "variable";

/// <summary>
/// Gets the name of the name argument.
/// </summary>
public const string NameArg = "name";

/// <summary>
/// Gets the name of the newName argument.
/// </summary>
public const string NewNameArg = "newName";

/// <summary>
/// Gets the name of the client grouping argument.
/// </summary>
public const string ClientGroupArg = "group";
public const string GroupArg = "group";

/// <summary>
/// Gets the name of the field argument.
/// </summary>
public const string FieldArg = "field";

/// <summary>
/// Gets the name of the select argument.
Expand Down Expand Up @@ -44,12 +59,22 @@ internal static class FusionDirectiveArgumentNames
/// Gets the name of the subgraph argument.
/// </summary>
public const string SubgraphArg = "subgraph";

/// <summary>
/// Gets the name of the subgraph argument.
/// </summary>
public const string FromArg = "from";

/// <summary>
/// Gets the name of the kind argument.
/// </summary>
public const string KindArg = "kind";

/// <summary>
/// Gets the name of the operation argument.
/// </summary>
public const string OperationArg = "operation";

/// <summary>
/// Gets the name of the prefix argument.
/// </summary>
Expand All @@ -69,4 +94,9 @@ internal static class FusionDirectiveArgumentNames
/// Gets the name of the location argument.
/// </summary>
public const string LocationArg = "location";

/// <summary>
/// Gets the name of the coordinate argument.
/// </summary>
public const string CoordinateArg = "coordinate";
}
85 changes: 63 additions & 22 deletions src/HotChocolate/Fusion/src/Abstractions/FusionTypeBaseNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,104 @@ namespace HotChocolate.Fusion;
internal static class FusionTypeBaseNames
{
/// <summary>
/// The base name of the variable directive.
/// The base name of the ArgumentDefinition input.
/// </summary>
public const string VariableDirective = "variable";
public const string ArgumentDefinition = "ArgumentDefinition";

/// <summary>
/// The base name of the resolver directive.
/// The base name of the declare directive.
/// </summary>
public const string ResolverDirective = "resolver";
public const string DeclareDirective = "declare";

/// <summary>
/// The base name of the source directive.
/// The base name of the fusion directive.
/// </summary>
public const string SourceDirective = "source";
public const string FusionDirective = "fusion";

/// <summary>
/// The base name of the is directive.
/// The base name of the is directive which is used during composition.
/// </summary>
public const string IsDirective = "is";

/// <summary>
/// The base name of the GraphQL name scalar.
/// </summary>
public const string Name = "TypeName";

/// <summary>
/// The base name of the node directive.
/// </summary>
public static string NodeDirective = "node";

/// <summary>
/// The base name of the GraphQL operation definition scalar.
/// </summary>
public const string OperationDefinition = "OperationDefinition";

/// <summary>
/// The base name of the private directive which is used during composition.
/// </summary>
public const string PrivateDirective = "private";

/// <summary>
/// The base name of the reEncodeId directive.
/// </summary>
public static string ReEncodeIdDirective = "reEncodeId";

/// <summary>
/// The base name of the transport directive.
/// The base name of the remove directive.
/// </summary>
public const string TransportDirective = "transport";
public const string RemoveDirective = "remove";

/// <summary>
/// The base name of the rename directive.
/// </summary>
public const string RenameDirective = "rename";

/// <summary>
/// The base name of the fusion directive.
/// The base name of the resolver directive.
/// </summary>
public const string FusionDirective = "fusion";
public const string ResolverDirective = "resolver";

/// <summary>
/// The base name of the ResolverKind input.
/// </summary>
public const string ResolverKind = "ResolverKind";

/// <summary>
/// The base name for the resolve directive which is used during composition.
/// </summary>
public const string ResolveDirective = "resolve";

/// <summary>
/// The base name of the GraphQL selection directive.
/// The base name of the require directive.
/// </summary>
public const string RequireDirective = "require"; // Note: the value seems to be a mistake as it's the same as RenameDirective's value.

/// <summary>
/// The base name of the GraphQL selection scalar.
/// </summary>
public const string Selection = "Selection";

/// <summary>
/// The base name of the GraphQL selection set directive.
/// The base name of the GraphQL selection set scalar.
/// </summary>
public const string SelectionSet = "SelectionSet";

/// <summary>
/// The base name of the GraphQL type name scalar.
/// The base name of the schema coordinate type.
/// </summary>
public const string TypeName = "TypeName";
public const string SchemaCoordinate = "SchemaCoordinate";

/// <summary>
/// The base name of the source directive.
/// </summary>
public const string SourceDirective = "source";

/// <summary>
/// The base name of the transport directive.
/// </summary>
public const string TransportDirective = "transport";

/// <summary>
/// The base name of the GraphQL type scalar.
Expand All @@ -71,13 +116,9 @@ internal static class FusionTypeBaseNames
public const string Uri = "Uri";

/// <summary>
/// The base name of the ArgumentDefinition input.
/// </summary>
public const string ArgumentDefinition = "ArgumentDefinition";

/// <summary>
/// The base name of the ResolverKind input.
/// The base name of the variable directive.
/// </summary>
public const string ResolverKind = "ResolverKind";
public const string VariableDirective = "variable";
}


Loading
Loading