diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Events/GroupEvents.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Events/GroupEvents.cs index f942098e5dc..675ac7b1df6 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Events/GroupEvents.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Events/GroupEvents.cs @@ -23,6 +23,11 @@ internal record InputTypeGroupEvent( string InputTypeName, ImmutableArray InputTypeGroup) : IEvent; +internal record ObjectFieldGroupEvent( + string FieldName, + ImmutableArray FieldGroup, + string TypeName) : IEvent; + internal record OutputFieldGroupEvent( string FieldName, ImmutableArray FieldGroup, diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Extensions/MutableComplexTypeDefinitionExtensions.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Extensions/MutableComplexTypeDefinitionExtensions.cs index da75c6876eb..9e5e33600f0 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Extensions/MutableComplexTypeDefinitionExtensions.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Extensions/MutableComplexTypeDefinitionExtensions.cs @@ -24,4 +24,9 @@ public static void ApplyKeyDirective(this MutableComplexTypeDefinition type, str new ArgumentAssignment(ArgumentNames.Fields, keyFields))); } } + + public static IEnumerable GetKeyDirectives(this MutableComplexTypeDefinition type) + { + return type.Directives.AsEnumerable().Where(d => d.Name == DirectiveNames.Key); + } } diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Extensions/MutableOutputFieldDefinitionExtensions.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Extensions/MutableOutputFieldDefinitionExtensions.cs index dda830a831f..b458dcd9e57 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Extensions/MutableOutputFieldDefinitionExtensions.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Extensions/MutableOutputFieldDefinitionExtensions.cs @@ -96,6 +96,14 @@ public static string GetKeyFields( return mergedSelectionSet.ToString(indented: false).AsSpan()[2..^2].ToString(); } + public static string? GetOverrideFrom(this MutableOutputFieldDefinition field) + { + var overrideDirective = + field.Directives.AsEnumerable().SingleOrDefault(d => d.Name == DirectiveNames.Override); + + return (string?)overrideDirective?.Arguments[ArgumentNames.From].Value; + } + public static bool HasInternalDirective(this MutableOutputFieldDefinition field) { return field.Directives.ContainsName(DirectiveNames.Internal); diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Extensions/OutputFieldDefinitionExtensions.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Extensions/OutputFieldDefinitionExtensions.cs index e9502f35b25..efc8ab5c553 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Extensions/OutputFieldDefinitionExtensions.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Extensions/OutputFieldDefinitionExtensions.cs @@ -1,4 +1,5 @@ using System.Collections.Immutable; +using HotChocolate.Features; using HotChocolate.Fusion.Features; using HotChocolate.Types; using static HotChocolate.Fusion.WellKnownArgumentNames; @@ -26,8 +27,9 @@ public static ImmutableArray GetSchemaNames( return [.. schemaNames]; } - public static SourceFieldMetadata? GetSourceFieldMetadata(this IOutputFieldDefinition field) + public static SourceFieldMetadata GetRequiredSourceFieldMetadata( + this IOutputFieldDefinition field) { - return field.Features.Get(); + return field.Features.GetRequired(); } } diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Extensions/OutputFieldInfoExtensions.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Extensions/OutputFieldInfoExtensions.cs deleted file mode 100644 index d195fc6b535..00000000000 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Extensions/OutputFieldInfoExtensions.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Collections.Immutable; -using HotChocolate.Fusion.Info; -using static HotChocolate.Fusion.WellKnownArgumentNames; -using static HotChocolate.Fusion.WellKnownDirectiveNames; - -namespace HotChocolate.Fusion.Extensions; - -internal static class OutputFieldInfoExtensions -{ - public static bool IsOverridden( - this OutputFieldInfo fieldInfo, - ImmutableArray fieldGroup) - { - var overriddenInSchemaNames = - fieldGroup - .Where(i => i.Field.Directives.ContainsName(Override)) - .Select(i => (string)i.Field.Directives[Override].First().Arguments[From].Value!) - .ToImmutableArray(); - - return overriddenInSchemaNames.Contains(fieldInfo.Schema.Name); - } -} diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Features/SourceFieldMetadata.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Features/SourceFieldMetadata.cs index b2a337b45d7..8897c5b5294 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Features/SourceFieldMetadata.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Features/SourceFieldMetadata.cs @@ -2,7 +2,15 @@ namespace HotChocolate.Fusion.Features; internal sealed class SourceFieldMetadata { + public bool HasShareableDirective { get; set; } + + public bool IsExternal { get; set; } + + public bool IsInternal { get; set; } + public bool IsKeyField { get; set; } + public bool IsOverridden { get; set; } + public bool IsShareable { get; set; } } diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Info/ObjectFieldInfo.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Info/ObjectFieldInfo.cs new file mode 100644 index 00000000000..4c675ad3f19 --- /dev/null +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Info/ObjectFieldInfo.cs @@ -0,0 +1,8 @@ +using HotChocolate.Types.Mutable; + +namespace HotChocolate.Fusion.Info; + +internal record ObjectFieldInfo( + MutableOutputFieldDefinition Field, + MutableObjectTypeDefinition Type, + MutableSchemaDefinition Schema); diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Logging/LogEntryCodes.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Logging/LogEntryCodes.cs index e64620c409e..7386e2c28df 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Logging/LogEntryCodes.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Logging/LogEntryCodes.cs @@ -25,6 +25,7 @@ public static class LogEntryCodes public const string InputFieldTypesNotMergeable = "INPUT_FIELD_TYPES_NOT_MERGEABLE"; public const string InputWithMissingRequiredFields = "INPUT_WITH_MISSING_REQUIRED_FIELDS"; public const string InterfaceFieldNoImplementation = "INTERFACE_FIELD_NO_IMPLEMENTATION"; + public const string InvalidFieldSharing = "INVALID_FIELD_SHARING"; public const string InvalidGraphQL = "INVALID_GRAPHQL"; public const string InvalidShareableUsage = "INVALID_SHAREABLE_USAGE"; public const string IsInvalidFields = "IS_INVALID_FIELDS"; diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Logging/LogEntryHelper.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Logging/LogEntryHelper.cs index d90795fef30..0008fc647de 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Logging/LogEntryHelper.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Logging/LogEntryHelper.cs @@ -440,6 +440,22 @@ public static LogEntry InterfaceFieldNoImplementation( .Build(); } + public static LogEntry InvalidFieldSharing( + MutableOutputFieldDefinition field, + MutableSchemaDefinition schema) + { + return LogEntryBuilder.New() + .SetMessage( + LogEntryHelper_InvalidFieldSharing, + field.Coordinate.ToString(), + schema.Name) + .SetCode(LogEntryCodes.InvalidFieldSharing) + .SetSeverity(LogSeverity.Error) + .SetTypeSystemMember(field) + .SetSchema(schema) + .Build(); + } + public static LogEntry InvalidGraphQL(string exceptionMessage, MutableSchemaDefinition schema) { return LogEntryBuilder.New() diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Options/SchemaComposerOptions.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Options/SchemaComposerOptions.cs index 3d7792dba2d..129006dd394 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Options/SchemaComposerOptions.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Options/SchemaComposerOptions.cs @@ -13,7 +13,7 @@ public sealed class SchemaComposerOptions /// /// Configuration options for preprocessing source schemas. /// - public SourceSchemaPreprocessorOptions Preprocessor { get; } = new(); + public Dictionary Preprocessor { get; } = new(); /// /// Configuration options for merging source schemas. diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Options/SourceSchemaPreprocessorOptions.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Options/SourceSchemaPreprocessorOptions.cs index 9da6102ceed..16fabfc2783 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Options/SourceSchemaPreprocessorOptions.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Options/SourceSchemaPreprocessorOptions.cs @@ -9,4 +9,10 @@ public sealed class SourceSchemaPreprocessorOptions /// Applies inferred key directives to types that are returned by lookup fields. /// public bool ApplyInferredKeyDirectives { get; set; } = true; + + /// + /// Applies key directives to types based on the keys defined on the interfaces that they + /// implement. + /// + public bool InheritInterfaceKeys { get; set; } = true; } diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/PreMergeValidationRules/InvalidFieldSharingRule.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/PreMergeValidationRules/InvalidFieldSharingRule.cs new file mode 100644 index 00000000000..7ce35aff11b --- /dev/null +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/PreMergeValidationRules/InvalidFieldSharingRule.cs @@ -0,0 +1,56 @@ +using System.Collections.Immutable; +using HotChocolate.Fusion.Events; +using HotChocolate.Fusion.Events.Contracts; +using HotChocolate.Fusion.Extensions; +using static HotChocolate.Fusion.Logging.LogEntryHelper; + +namespace HotChocolate.Fusion.PreMergeValidationRules; + +/// +/// +/// A field in a federated GraphQL schema may be marked @shareable, indicating that the same +/// field can be resolved by multiple schemas without conflict. When a field is not marked as +/// @shareable (sometimes called “non-shareable”), it cannot be provided by more than one +/// schema. +/// +/// +/// Field definitions marked as @external and overridden fields are excluded when validating +/// whether a field is shareable. These annotations indicate specific cases where field ownership +/// lies with another schema or has been replaced. +/// +/// +/// +/// Specification +/// +internal sealed class InvalidFieldSharingRule : IEventHandler +{ + public void Handle(ObjectFieldGroupEvent @event, CompositionContext context) + { + var fieldGroup = @event.FieldGroup; + + // Exclude external and overridden fields. + var filteredFieldGroup = + fieldGroup + .Where( + i => i.Field.GetRequiredSourceFieldMetadata() is + { + IsExternal: false, + IsOverridden: false + }) + .ToImmutableArray(); + + if (filteredFieldGroup.Length < 2) + { + return; + } + + // Remaining fields must be shareable. + foreach (var (field, _, schema) in filteredFieldGroup) + { + if (!field.GetRequiredSourceFieldMetadata().IsShareable) + { + context.Log.Write(InvalidFieldSharing(field, schema)); + } + } + } +} diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/PreMergeValidator.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/PreMergeValidator.cs index 1eccc7b77cb..dcd88d09a91 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/PreMergeValidator.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/PreMergeValidator.cs @@ -50,6 +50,7 @@ private void PublishEvents() MultiValueDictionary inputTypeGroupByName = []; MultiValueDictionary inputFieldGroupByName = []; MultiValueDictionary outputFieldGroupByName = []; + MultiValueDictionary objectFieldGroupByName = []; MultiValueDictionary enumTypeGroupByName = []; foreach (var (type, schema) in typeGroup) @@ -81,6 +82,13 @@ private void PublishEvents() outputFieldGroupByName.Add( field.Name, new OutputFieldInfo(field, complexType, schema)); + + if (complexType is MutableObjectTypeDefinition objectType) + { + objectFieldGroupByName.Add( + field.Name, + new ObjectFieldInfo(field, objectType, schema)); + } } break; @@ -131,6 +139,12 @@ private void PublishEvents() } } + foreach (var (fieldName, fieldGroup) in objectFieldGroupByName) + { + PublishEvent( + new ObjectFieldGroupEvent(fieldName, [.. fieldGroup], typeName), context); + } + foreach (var (enumName, enumGroup) in enumTypeGroupByName) { PublishEvent(new EnumTypeGroupEvent(enumName, [.. enumGroup]), context); diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Properties/CompositionResources.Designer.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Properties/CompositionResources.Designer.cs index 1f8f5cee089..00adbccf317 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Properties/CompositionResources.Designer.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Properties/CompositionResources.Designer.cs @@ -752,6 +752,15 @@ internal static string LogEntryHelper_InterfaceFieldNoImplementation { } } + /// + /// Looks up a localized string similar to The field '{0}' in schema '{1}' must be shareable.. + /// + internal static string LogEntryHelper_InvalidFieldSharing { + get { + return ResourceManager.GetString("LogEntryHelper_InvalidFieldSharing", resourceCulture); + } + } + /// /// Looks up a localized string similar to Invalid GraphQL in source schema. Exception message: {0}.. /// @@ -762,7 +771,7 @@ internal static string LogEntryHelper_InvalidGraphQL { } /// - /// Looks up a localized string similar to The interface field '{0}' in schema '{1}' must not be marked as shareable.. + /// Looks up a localized string similar to The field '{0}' in schema '{1}' must not be marked as shareable.. /// internal static string LogEntryHelper_InvalidShareableUsage { get { diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Properties/CompositionResources.resx b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Properties/CompositionResources.resx index feebaf1e662..66f10dd4e44 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Properties/CompositionResources.resx +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Properties/CompositionResources.resx @@ -249,11 +249,14 @@ The merged object type '{0}' must implement the field '{1}' on interface '{2}'. + + The field '{0}' in schema '{1}' must be shareable. + Invalid GraphQL in source schema. Exception message: {0}. - The interface field '{0}' in schema '{1}' must not be marked as shareable. + The field '{0}' in schema '{1}' must not be marked as shareable. The @is directive on argument '{0}' in schema '{1}' specifies an invalid field selection against the composed schema. diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SchemaComposer.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SchemaComposer.cs index 5bf2eaa4fb6..36afe26a126 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SchemaComposer.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SchemaComposer.cs @@ -43,9 +43,21 @@ public CompositionResult Compose() } // Preprocess Source Schemas - var preprocessorOptions = _schemaComposerOptions.Preprocessor; var preprocessResult = - schemas.Select(schema => new SourceSchemaPreprocessor(schema, preprocessorOptions).Process()).Combine(); + schemas.Select(schema => + { + var optionsExist = + _schemaComposerOptions.Preprocessor.TryGetValue( + schema.Name, + out var preprocessorOptions); + + if (!optionsExist) + { + preprocessorOptions = new SourceSchemaPreprocessorOptions(); + } + + return new SourceSchemaPreprocessor(schema, preprocessorOptions).Process(); + }).Combine(); if (preprocessResult.IsFailure) { @@ -53,7 +65,8 @@ public CompositionResult Compose() } // Enrich Source Schemas - var enrichmentResult = schemas.Select(schema => new SourceSchemaEnricher(schema).Enrich()).Combine(); + var enrichmentResult = + schemas.Select(schema => new SourceSchemaEnricher(schema, schemas).Enrich()).Combine(); if (enrichmentResult.IsFailure) { @@ -154,6 +167,7 @@ public CompositionResult Compose() new InputFieldDefaultMismatchRule(), new InputFieldTypesMergeableRule(), new InputWithMissingRequiredFieldsRule(), + new InvalidFieldSharingRule(), new OutputFieldTypesMergeableRule(), new TypeKindMismatchRule() ]; diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaEnricher.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaEnricher.cs index f83f8fd6a98..fad788c4849 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaEnricher.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaEnricher.cs @@ -1,3 +1,4 @@ +using System.Collections.Immutable; using HotChocolate.Features; using HotChocolate.Fusion.Extensions; using HotChocolate.Fusion.Features; @@ -10,7 +11,9 @@ namespace HotChocolate.Fusion; -internal sealed class SourceSchemaEnricher(MutableSchemaDefinition schema) +internal sealed class SourceSchemaEnricher( + MutableSchemaDefinition schema, + ImmutableSortedSet schemas) { public CompositionResult Enrich() { @@ -35,16 +38,37 @@ public CompositionResult Enrich() return CompositionResult.Success(); } - private static void EnrichField(MutableOutputFieldDefinition field, MutableComplexTypeDefinition complexType) + private void EnrichField( + MutableOutputFieldDefinition field, + MutableComplexTypeDefinition complexType) { var sourceFieldMetadata = field.Features.GetOrSet(); + sourceFieldMetadata.IsExternal = field.HasExternalDirective(); + sourceFieldMetadata.IsInternal = + field.HasInternalDirective() + || (complexType is MutableObjectTypeDefinition objectType && objectType.HasInternalDirective()); + + sourceFieldMetadata.HasShareableDirective = field.HasShareableDirective(); + + // Overridden fields. + foreach (var sourceSchema in schemas.Except([schema])) + { + if (sourceSchema.Types.TryGetType(complexType.Name, out var sourceType) + && sourceType is MutableComplexTypeDefinition sourceComplexType + && sourceComplexType.Fields.TryGetField(field.Name, out var sourceField) + && sourceField.GetOverrideFrom() == schema.Name) + { + sourceFieldMetadata.IsOverridden = true; + } + } + // Shareable fields. if (!field.HasExternalDirective() && ( sourceFieldMetadata.IsKeyField || field.HasShareableDirective() - || (complexType is MutableObjectTypeDefinition objectType && objectType.HasShareableDirective()))) + || (complexType is MutableObjectTypeDefinition o && o.HasShareableDirective()))) { sourceFieldMetadata.IsShareable = true; } @@ -59,11 +83,24 @@ private static List GetKeyFields( foreach (var keyDirective in keyDirectives) { - var fieldsArgument = ((StringValueNode)keyDirective.Arguments[ArgumentNames.Fields]).Value; - var selectionSet = Utf8GraphQLParser.Syntax.ParseSelectionSet($"{{ {fieldsArgument} }}"); - var fieldsExtractor = new SelectionSetFieldsExtractor(schema); - var fieldGroup = fieldsExtractor.ExtractFields(selectionSet, complexType); - keyFields.AddRange(fieldGroup.Select(f => f.Field)); + if (!keyDirective.Arguments.TryGetValue(ArgumentNames.Fields, out var fieldsValueNode) + || fieldsValueNode is not StringValueNode stringValueNode) + { + continue; + } + + try + { + var fieldsArgument = stringValueNode.Value; + var selectionSet = Utf8GraphQLParser.Syntax.ParseSelectionSet($"{{ {fieldsArgument} }}"); + var fieldsExtractor = new SelectionSetFieldsExtractor(schema); + var fieldGroup = fieldsExtractor.ExtractFields(selectionSet, complexType); + keyFields.AddRange(fieldGroup.Select(f => f.Field)); + } + catch (SyntaxException) + { + // Validated later. + } } return keyFields; diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaMerger.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaMerger.cs index 6f55bd85f98..0a85f854e89 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaMerger.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaMerger.cs @@ -775,10 +775,14 @@ .. typeGroup.Where( MutableSchemaDefinition mergedSchema) { // Filter out internal or overridden fields. - var group = fieldGroup; fieldGroup = [ - .. fieldGroup.Where(i => !i.Field.HasInternalDirective() && !i.IsOverridden(group)) + .. fieldGroup.Where( + i => i.Field.GetRequiredSourceFieldMetadata() is + { + IsInternal: false, + IsOverridden: false + }) ]; if (fieldGroup.Length == 0) diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaPreprocessor.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaPreprocessor.cs index 57ffae767fe..5c9411ab860 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaPreprocessor.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaPreprocessor.cs @@ -1,8 +1,10 @@ using HotChocolate.Fusion.Extensions; +using HotChocolate.Fusion.Language; using HotChocolate.Fusion.Options; using HotChocolate.Fusion.Results; using HotChocolate.Types; using HotChocolate.Types.Mutable; +using ArgumentNames = HotChocolate.Fusion.WellKnownArgumentNames; namespace HotChocolate.Fusion; @@ -22,6 +24,11 @@ public CompositionResult Process() ApplyInferredKeyDirectives(); } + if (_options.InheritInterfaceKeys) + { + InheritInterfaceKeys(); + } + return CompositionResult.Success(); } @@ -40,16 +47,43 @@ private void ApplyInferredKeyDirectives() var fieldType = lookupFieldDefinition.Type.AsTypeDefinition(); var possibleTypes = schema.GetPossibleTypes(fieldType); var lookupMap = lookupFieldDefinition.GetFusionLookupMap(); - var keyFields = lookupFieldDefinition.GetKeyFields(lookupMap, schema); - foreach (var possibleType in possibleTypes) + try + { + var keyFields = lookupFieldDefinition.GetKeyFields(lookupMap, schema); + + foreach (var possibleType in possibleTypes) + { + possibleType.ApplyKeyDirective(keyFields); + } + + if (fieldType is MutableInterfaceTypeDefinition interfaceType) + { + interfaceType.ApplyKeyDirective(keyFields); + } + } + catch (FieldSelectionMapSyntaxException) { - possibleType.ApplyKeyDirective(keyFields); + // Validated later. } + } + } - if (fieldType is MutableInterfaceTypeDefinition interfaceType) + /// + /// Applies key directives to types based on the keys defined on the interfaces that they + /// implement. + /// + private void InheritInterfaceKeys() + { + foreach (var complexType in schema.Types.OfType()) + { + foreach (var interfaceType in complexType.Implements) { - interfaceType.ApplyKeyDirective(keyFields); + foreach (var keyDirective in interfaceType.GetKeyDirectives()) + { + var fieldsArgument = keyDirective.Arguments[ArgumentNames.Fields].Value!; + complexType.ApplyKeyDirective((string)fieldsArgument); + } } } } diff --git a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaValidationRules/InvalidShareableUsageRule.cs b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaValidationRules/InvalidShareableUsageRule.cs index b51fd3b23e8..566bc1f14cc 100644 --- a/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaValidationRules/InvalidShareableUsageRule.cs +++ b/src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaValidationRules/InvalidShareableUsageRule.cs @@ -18,6 +18,12 @@ namespace HotChocolate.Fusion.SourceSchemaValidationRules; /// @shareable is used only in contexts where shared field resolution is meaningful and /// unambiguous. /// +/// +/// Additionally, subscription root fields cannot be shared (i.e., they are effectively +/// non-shareable), as subscription events from multiple schemas would create conflicts in the +/// composed schema. Attempting to mark a subscription field as shareable or to define it in +/// multiple schemas triggers the same error. +/// /// /// /// Specification @@ -28,9 +34,17 @@ public void Handle(OutputFieldEvent @event, CompositionContext context) { var (field, type, schema) = @event; + // Applying @shareable to interface fields is disallowed. if (type is MutableInterfaceTypeDefinition && field.HasShareableDirective()) { context.Log.Write(InvalidShareableUsage(field, schema)); } + + // Subscription root fields cannot be shared. + if (type.Name == WellKnownTypeNames.Subscription + && field.GetRequiredSourceFieldMetadata().HasShareableDirective) + { + context.Log.Write(InvalidShareableUsage(field, schema)); + } } } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/AbstractTypeTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/AbstractTypeTests.cs index e52a384fa1e..dbd6e154d97 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/AbstractTypeTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/AbstractTypeTests.cs @@ -297,6 +297,7 @@ public IEnumerable InterfaceConnection() } [InterfaceType] + [EntityKey("id")] public interface SharedType { int Id { get; } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/BookStoreTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/BookStoreTests.cs index 93a59afc28c..0aaa68cc267 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/BookStoreTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/BookStoreTests.cs @@ -612,8 +612,9 @@ public async Task Ensure_String_Variables_Can_Be_Empty() public static class SourceSchema1 { - public record Book(int Id, string Title, Author Author); + public record Book(int Id, string Title, [property: Shareable] Author Author); + [EntityKey("id")] public record Author(int Id); public class Query @@ -696,7 +697,7 @@ public IEnumerable GetAuthors() => _authors.Values; } - public record Book(int Id, Author Author) + public record Book(int Id, [property: Shareable] Author Author) { public string IdAndTitle([Require] string title) => $"{Id} - {title}"; diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/ConditionalTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/ConditionalTests.cs index ace966bf06d..f2101e9c0bb 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/ConditionalTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/ConditionalTests.cs @@ -15,7 +15,7 @@ public async Task SharedPath_Skip_On_Entry_Field() "A", """ type Query { - viewer: Viewer + viewer: Viewer @shareable } type Viewer { @@ -27,7 +27,7 @@ type Viewer { "B", """ type Query { - viewer: Viewer + viewer: Viewer @shareable } type Viewer { @@ -131,7 +131,7 @@ public async Task SharedPath_Skip_On_Field_Below_Entry_Field() "A", """ type Query { - viewer: Viewer + viewer: Viewer @shareable } type Viewer { @@ -143,7 +143,7 @@ type Viewer { "B", """ type Query { - viewer: Viewer + viewer: Viewer @shareable } type Viewer { @@ -636,7 +636,7 @@ type Product { review: Review } - type Review { + type Review @key(fields: "id") { id: ID! } """); @@ -701,7 +701,7 @@ type Product { review: Review } - type Review { + type Review @key(fields: "id") { id: ID! } """); @@ -770,7 +770,7 @@ type Product { review: Review } - type Review { + type Review @key(fields: "id") { id: ID! } """); @@ -833,7 +833,7 @@ public async Task Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Look """ type Query { productBySlug(slug: String!): Product - reviewById(id: ID!): Review @lookup + reviewById(id: ID!): Review @lookup @shareable } type Product { @@ -852,7 +852,7 @@ type Review { "B", """ type Query { - reviewById(id: ID!): Review @lookup + reviewById(id: ID!): Review @lookup @shareable } type Review { @@ -915,7 +915,7 @@ type Product { review: Review } - type Review { + type Review @key(fields: "id") { id: ID! } """); @@ -980,7 +980,7 @@ type Product { review: Review } - type Review { + type Review @key(fields: "id") { id: ID! } """); @@ -1115,7 +1115,7 @@ type Query { productBySlug(slug: String!): Product } - type Product { + type Product @key(fields: "id") { id: ID! } """); @@ -1124,7 +1124,7 @@ type Product { "B", """ type Query { - productById(id: ID!): Product @lookup + productById(id: ID!): Product @lookup @shareable } type Product { @@ -1137,7 +1137,7 @@ type Product { "C", """ type Query { - productById(id: ID!): Product @lookup + productById(id: ID!): Product @lookup @shareable } type Product { @@ -1418,7 +1418,7 @@ public async Task NodeField_Skip_On_Shared_Selection() "A", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { @@ -1435,7 +1435,7 @@ type Discussion implements Node { "B", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { @@ -1487,7 +1487,7 @@ public async Task NodeField_Skip_Around_Shared_Selections() "A", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { @@ -1504,7 +1504,7 @@ type Discussion implements Node { "B", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { @@ -1660,7 +1660,7 @@ public async Task NodeField_Skip_Around_Multiple_Type_Refinements() "A", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { @@ -1677,7 +1677,7 @@ type Discussion implements Node { "B", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/DiagnisticListenerTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/DiagnisticListenerTests.cs index 57ceb8f9a5e..2bbc2c4d210 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/DiagnisticListenerTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/DiagnisticListenerTests.cs @@ -63,8 +63,9 @@ public override IDisposable ExecuteOperation(RequestContext context) public static class SourceSchema1 { - public record Book(int Id, string Title, Author Author); + public record Book(int Id, string Title, [property: Shareable] Author Author); + [EntityKey("id")] public record Author(int Id); public class Query @@ -140,7 +141,7 @@ public IEnumerable GetAuthors() => _authors.Values; } - public record Book(int Id, Author Author) + public record Book(int Id, [property: Shareable] Author Author) { public string IdAndTitle([Require] string title) => $"{Id} - {title}"; diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/GlobalObjectIdentificationTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/GlobalObjectIdentificationTests.cs index a31075368bf..ef296314662 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/GlobalObjectIdentificationTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/GlobalObjectIdentificationTests.cs @@ -15,7 +15,7 @@ public async Task Concrete_Type_Branch_Requested() "A", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } @@ -32,7 +32,7 @@ type Discussion implements Node { "B", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(id: ID!): Discussion @lookup @internal } @@ -89,7 +89,7 @@ public async Task Concrete_Type_Branch_Requested_Abstract_Lookup() "A", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } @@ -106,7 +106,7 @@ type Discussion implements Node { "B", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(id: ID!): Discussion @lookup @internal } @@ -163,7 +163,7 @@ public async Task Invalid_Id_Requested() "A", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } @@ -180,7 +180,7 @@ type Discussion implements Node { "B", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(id: ID!): Discussion @lookup @internal } @@ -235,7 +235,7 @@ public async Task Id_Of_Unknown_Type_Requested() "A", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } @@ -252,7 +252,7 @@ type Discussion implements Node { "B", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(id: ID!): Discussion @lookup @internal } @@ -308,7 +308,7 @@ public async Task Id_Of_Type_Different_From_Concrete_Type_Selections_Requested() "A", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } @@ -325,7 +325,7 @@ type Discussion implements Node { "B", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(id: ID!): Discussion @lookup @internal } @@ -381,7 +381,7 @@ public async Task Only_Typename_Selected() "A", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { @@ -399,7 +399,7 @@ type Discussion implements Node { """ type Query { authorById(id: ID!): Author @lookup - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { @@ -495,7 +495,7 @@ public async Task Only_TypeName_Selected_On_Concrete_Type() "A", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } @@ -512,7 +512,7 @@ type Discussion implements Node { "B", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(id: ID!): Discussion @lookup @internal } @@ -566,7 +566,7 @@ type Query { discussionByName(title: String! @is(field: "title")): Discussion @lookup } - type Discussion { + type Discussion @key(fields: "id") { id: ID! title: String! commentCount: Int! @@ -584,7 +584,7 @@ interface Node { id: ID! } - type Discussion implements Node { + type Discussion implements Node @key(fields: "title") { id: ID! title: String! } @@ -627,7 +627,7 @@ public async Task Two_Node_Fields_With_Alias() "A", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } @@ -644,7 +644,7 @@ type Discussion implements Node { "B", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussion(id: ID!): Discussion @lookup } @@ -780,7 +780,7 @@ type Query { discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } - interface Node { + interface Node @key(fields: "id") { id: ID! } @@ -828,7 +828,7 @@ public async Task Node_Field_Concrete_Type_Selection_Has_Dependency() "A", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(id: ID!): Discussion @lookup } @@ -842,7 +842,7 @@ type Discussion implements Node { product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } """); @@ -851,7 +851,7 @@ type Product { "B", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { @@ -905,7 +905,7 @@ public async Task Node_Field_Two_Concrete_Types_Selections_Have_Same_Dependency( "A", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { @@ -917,7 +917,7 @@ type Discussion implements Node { product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } """); @@ -926,7 +926,7 @@ type Product { "B", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { @@ -938,7 +938,7 @@ type Review implements Node { product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } """); @@ -947,7 +947,7 @@ type Product { "C", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { @@ -1005,7 +1005,7 @@ public async Task Node_Field_Two_Concrete_Types_Selections_Have_Different_Depend "A", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { @@ -1017,7 +1017,7 @@ type Discussion implements Node { product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } """); @@ -1026,7 +1026,7 @@ type Product { "B", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { @@ -1038,7 +1038,7 @@ type Review implements Node { product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } """); @@ -1047,7 +1047,7 @@ type Product { "C", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { @@ -1227,7 +1227,7 @@ public async Task Node_Field_Selections_On_Interface_And_Concrete_Type_Both_Have "A", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { @@ -1258,7 +1258,7 @@ type Product implements Node { "B", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { @@ -1318,7 +1318,7 @@ public async Task Node_Field_Selections_On_Interface_Selection_Has_Dependency() "A", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { @@ -1348,7 +1348,7 @@ type Product implements Node { "B", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interface Node { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/InterfaceTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/InterfaceTests.cs index 126466a9446..bbae8434aee 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/InterfaceTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/InterfaceTests.cs @@ -82,7 +82,7 @@ type Comment implements Authorable { author: Author } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -152,7 +152,7 @@ type Comment implements Authorable { author: Author } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -228,7 +228,7 @@ type Comment implements Authorable { author: Author } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -345,7 +345,7 @@ public async Task Interface_Field_Concrete_Type_With_Dependency() """ type Query { votable: Votable - discussionById(id: ID!): Discussion @lookup + discussionById(id: ID!): Discussion @lookup @shareable } interface Votable { @@ -367,7 +367,7 @@ type Comment implements Votable { "B", """ type Query { - discussionById(id: ID!): Discussion @lookup + discussionById(id: ID!): Discussion @lookup @shareable } type Discussion { @@ -431,7 +431,7 @@ type Comment implements Votable { viewerCanVote: Boolean! } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -762,7 +762,7 @@ type Comment implements Authorable { author: Author } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -832,7 +832,7 @@ type Comment implements Authorable { author: Author } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -908,7 +908,7 @@ type Comment implements Authorable { author: Author } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -1025,7 +1025,7 @@ public async Task Interface_List_Field_Concrete_Type_With_Dependency() """ type Query { votables: [Votable] - discussionById(id: ID!): Discussion @lookup + discussionById(id: ID!): Discussion @lookup @shareable } interface Votable { @@ -1047,7 +1047,7 @@ type Comment implements Votable { "B", """ type Query { - discussionById(id: ID!): Discussion @lookup + discussionById(id: ID!): Discussion @lookup @shareable } type Discussion { @@ -1111,7 +1111,7 @@ type Comment implements Votable { viewerCanVote: Boolean! } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -1191,7 +1191,7 @@ type Comment implements Authorable { author: Author } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -1267,7 +1267,7 @@ type Comment implements Authorable { author: Author } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -1348,7 +1348,7 @@ type Comment implements Authorable { author: Author } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -1472,7 +1472,7 @@ public async Task List_Field_Interface_Object_Property_Concrete_Type_With_Depend """ type Query { wrappers: [Wrapper] - discussionById(id: ID!): Discussion @lookup + discussionById(id: ID!): Discussion @lookup @shareable } type Wrapper { @@ -1498,7 +1498,7 @@ type Comment implements Votable { "B", """ type Query { - discussionById(id: ID!): Discussion @lookup + discussionById(id: ID!): Discussion @lookup @shareable } type Discussion { @@ -1568,7 +1568,7 @@ type Comment implements Votable { viewerCanVote: Boolean! } - type Author { + type Author @key(fields: "id") { id: ID! } """); diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/IntrospectionTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/IntrospectionTests.cs index 5478634ed0a..b24c5fd0709 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/IntrospectionTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/IntrospectionTests.cs @@ -522,8 +522,9 @@ directive @test("Directive argument description" arg: String! = "default") repea public static class SourceSchema1 { - public record Book(int Id, string Title, Author Author); + public record Book(int Id, string Title, [property: Shareable] Author Author); + [EntityKey("id")] public record Author(int Id); public class Query @@ -585,6 +586,7 @@ public IEnumerable GetAuthors() => _authors.Values; } - public record Book(int Id, Author Author); + [EntityKey("id")] + public record Book(int Id, [property: Shareable] Author Author); } } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/MutationTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/MutationTests.cs index fb4516a4df5..0a951d64e09 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/MutationTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/MutationTests.cs @@ -117,6 +117,7 @@ public record CreateBookInput(string Title); public record CreateBookPayload(Book Book); + [EntityKey("id")] public record Book(int Id, string Title); } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/OperationPlannerInterceptorTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/OperationPlannerInterceptorTests.cs index 49a5d4ea9e8..93de7bc293e 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/OperationPlannerInterceptorTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/OperationPlannerInterceptorTests.cs @@ -117,8 +117,9 @@ public void OnAfterPlanCompleted( public static class SourceSchema1 { - public record Book(int Id, string Title, Author Author); + public record Book(int Id, string Title, [property: Shareable] Author Author); + [EntityKey("id")] public record Author(int Id); public class Query @@ -194,7 +195,7 @@ public IEnumerable GetAuthors() => _authors.Values; } - public record Book(int Id, Author Author) + public record Book(int Id, [property: Shareable] Author Author) { public string IdAndTitle([Require] string title) => $"{Id} - {title}"; diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/RequireTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/RequireTests.cs index cd1657159b5..c00eb25e89f 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/RequireTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/RequireTests.cs @@ -205,6 +205,7 @@ public Book[] GetBooks() => s_books.Values.ToArray(); [Lookup] + [Shareable] public Book? GetBook(int id) => s_books.TryGetValue(id, out var book) ? book : null; } @@ -238,6 +239,7 @@ public static class BookInventory public class Query { [Lookup] + [Shareable] public Book? GetBook(int id) => s_books.TryGetValue(id, out var book) ? book : null; } @@ -269,6 +271,7 @@ public static class BookGenre public class Query { [Lookup] + [Shareable] public Book? GetBook(int id) => new() { Id = id }; } @@ -296,6 +299,7 @@ public static class BookShipping public class Query { [Lookup] + [Shareable] public Book? GetBook(int id) => new() { Id = id }; } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/SharedPathTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/SharedPathTests.cs index 188e9491587..f4a4d2bfb52 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/SharedPathTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/SharedPathTests.cs @@ -568,16 +568,20 @@ public static class SourceSchema1 { public class Query { + [Shareable] public Viewer Viewer => new Viewer(); public string Schema1 => "schema1"; + [Shareable] public IInterface Interface => new Review(1); public IInterface UnsharedInterface => new Product(2); + [Shareable] public IUnion Union => new Review(2); + [Shareable] public Review TopReview => new Review(3); [Lookup] @@ -588,6 +592,7 @@ public class Viewer { public string Schema1 => "schema1"; + [Shareable] public ViewerSettings Settings => new ViewerSettings(); } @@ -600,6 +605,7 @@ public record Product(int Id) : IInterface, IUnion { public string Schema1 => "schema1"; + [Shareable] public SharedProduct? Shared => new SharedProduct(); } @@ -612,6 +618,7 @@ public class SharedProduct { public string Schema1 => "schema1"; + [Shareable] public SharedProduct2? Shared2 => new SharedProduct2(); } @@ -620,6 +627,7 @@ public class SharedProduct2 public string Schema1 => "schema1"; } + [EntityKey("id")] public interface IInterface { int Id { get; } @@ -633,14 +641,18 @@ public static class SourceSchema2 { public class Query { + [Shareable] public Viewer Viewer => new Viewer(); public string Schema2 => "schema2"; + [Shareable] public IInterface Interface => new Review(1); + [Shareable] public IUnion Union => new Review(2); + [Shareable] public Review TopReview => new Review(3); [Lookup] @@ -651,6 +663,7 @@ public class Viewer { public string Schema2 => "schema2"; + [Shareable] public ViewerSettings Settings => new ViewerSettings(); } @@ -663,6 +676,7 @@ public record Product(int Id) : IInterface, IUnion { public string Schema2 => "schema2"; + [Shareable] public SharedProduct? Shared => new SharedProduct(); } @@ -675,6 +689,7 @@ public class SharedProduct { public string Schema2 => "schema2"; + [Shareable] public SharedProduct2? Shared2 => new SharedProduct2(); } @@ -683,6 +698,7 @@ public class SharedProduct2 public string Schema2 => "schema2"; } + [EntityKey("id")] public interface IInterface { int Id { get; } @@ -696,6 +712,7 @@ public static class SourceSchema3 { public class Query { + [Shareable] public Viewer Viewer => new Viewer(); } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/SubscriptionsOverHttpStoreTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/SubscriptionsOverHttpStoreTests.cs index e0245044b8b..994384f20c6 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/SubscriptionsOverHttpStoreTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/SubscriptionsOverHttpStoreTests.cs @@ -51,6 +51,7 @@ public async Task Subscribe_Simple() public static class SourceSchema1 { + [EntityKey("id")] public record Book(int Id); public class Query diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/UnionTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/UnionTests.cs index 9bdf271156b..b363cb6ec35 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/UnionTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/UnionTests.cs @@ -74,7 +74,7 @@ type Query { union Post = Photo | Discussion - type Photo { + type Photo @key(fields: "id") { id: ID! } @@ -151,11 +151,11 @@ type Discussion { author: Author } - type Product { + type Product @key(fields: "id") { id: ID! } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -245,11 +245,11 @@ type Discussion { author: Author } - type Product { + type Product @key(fields: "id") { id: ID! } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -331,7 +331,7 @@ type Discussion { product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } """); @@ -401,7 +401,7 @@ type Query { union Post = Photo | Discussion - type Photo { + type Photo @key(fields: "id") { id: ID! } @@ -478,11 +478,11 @@ type Discussion { author: Author } - type Product { + type Product @key(fields: "id") { id: ID! } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -572,11 +572,11 @@ type Discussion { author: Author } - type Product { + type Product @key(fields: "id") { id: ID! } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -658,7 +658,7 @@ type Discussion { product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } """); @@ -732,7 +732,7 @@ type PostEdge { union Post = Photo | Discussion - type Photo { + type Photo @key(fields: "id") { id: ID! } @@ -815,11 +815,11 @@ type Discussion { author: Author } - type Product { + type Product @key(fields: "id") { id: ID! } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -915,11 +915,11 @@ type Discussion { author: Author } - type Product { + type Product @key(fields: "id") { id: ID! } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -1007,7 +1007,7 @@ type Discussion { product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } """); @@ -1083,7 +1083,7 @@ type User { union Post = Photo | Discussion - type Photo { + type Photo @key(fields: "id") { id: ID! } @@ -1166,11 +1166,11 @@ type Discussion { author: Author } - type Product { + type Product @key(fields: "id") { id: ID! } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -1266,11 +1266,11 @@ type Discussion { author: Author } - type Product { + type Product @key(fields: "id") { id: ID! } - type Author { + type Author @key(fields: "id") { id: ID! } """); @@ -1358,7 +1358,7 @@ type Discussion { product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } """); diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type.yaml index 5631fb55738..251dcda3eaf 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type.yaml @@ -29,7 +29,7 @@ sourceSchemas: query: Query } - interface SharedType { + interface SharedType @key(fields: "id") { id: Int! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_Direct_Source_Schema_Call.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_Direct_Source_Schema_Call.yaml index 3c782978db7..00fda98df2d 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_Direct_Source_Schema_Call.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_Direct_Source_Schema_Call.yaml @@ -38,7 +38,7 @@ sourceSchemas: query: Query } - interface SharedType { + interface SharedType @key(fields: "id") { id: Int! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_With_Abstract_Lookup.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_With_Abstract_Lookup.yaml index 60f0c5ac709..7ac77b3db47 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_With_Abstract_Lookup.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_With_Abstract_Lookup.yaml @@ -28,7 +28,7 @@ sourceSchemas: query: Query } - interface SharedType { + interface SharedType @key(fields: "id") { id: Int! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_With_Concrete_Lookup.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_With_Concrete_Lookup.yaml index 3b364fee1ec..6427cd3d63c 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_With_Concrete_Lookup.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Abstract_Type_With_Concrete_Lookup.yaml @@ -28,7 +28,7 @@ sourceSchemas: query: Query } - interface SharedType { + interface SharedType @key(fields: "id") { id: Int! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Concrete_Type_With_Abstract_Lookup.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Concrete_Type_With_Abstract_Lookup.yaml index 4e758892c46..7bac1c4830b 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Concrete_Type_With_Abstract_Lookup.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.Concrete_Type_With_Abstract_Lookup.yaml @@ -24,7 +24,7 @@ sourceSchemas: query: Query } - interface SharedType { + interface SharedType @key(fields: "id") { id: Int! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.List_Of_Abstract_Types.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.List_Of_Abstract_Types.yaml index a9b41a56a1b..6eda16cf5ba 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.List_Of_Abstract_Types.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/AbstractTypeTests.List_Of_Abstract_Types.yaml @@ -38,7 +38,7 @@ sourceSchemas: query: Query } - interface SharedType { + interface SharedType @key(fields: "id") { id: Int! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Introspection_Skip_Around_Field.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Introspection_Skip_Around_Field.yaml index 0a5e1fa8b94..021a78d0f86 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Introspection_Skip_Around_Field.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Introspection_Skip_Around_Field.yaml @@ -26,7 +26,7 @@ sourceSchemas: schema { query: Query } - + type Query { field: String } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Introspection_Skip_On_Field.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Introspection_Skip_On_Field.yaml index c09839e5a08..1bdc5ecc51e 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Introspection_Skip_On_Field.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Introspection_Skip_On_Field.yaml @@ -21,7 +21,7 @@ sourceSchemas: schema { query: Query } - + type Query { field: String } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Lookup.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Lookup.yaml index 1d613bcf750..fc03e541d02 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Lookup.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Lookup.yaml @@ -38,18 +38,18 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! name: String! review: Review } - + type Query { productBySlug(slug: String!): Product } - - type Review { + + type Review @key(fields: "id") { id: ID! } interactions: @@ -91,11 +91,11 @@ sourceSchemas: schema { query: Query } - + type Query { reviewById(id: ID!): Review @lookup } - + type Review { id: ID! title: String! diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Lookup_And_On_Same_Source_Schema.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Lookup_And_On_Same_Source_Schema.yaml index 3fead9c37b1..aab42fe8f1b 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Lookup_And_On_Same_Source_Schema.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Multiple_Skip_Levels_Around_Fields_Fetched_Through_Lookup_And_On_Same_Source_Schema.yaml @@ -39,18 +39,18 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! name: String! review: Review } - + type Query { productBySlug(slug: String!): Product - reviewById(id: ID!): Review @lookup + reviewById(id: ID!): Review @lookup @shareable } - + type Review { id: ID! author: String! @@ -95,11 +95,11 @@ sourceSchemas: schema { query: Query } - + type Query { - reviewById(id: ID!): Review @lookup + reviewById(id: ID!): Review @lookup @shareable } - + type Review { id: ID! title: String! diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Around_Field_With_Requirement_With_Other_Field.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Around_Field_With_Requirement_With_Other_Field.yaml index ccc25e5e51b..0816144e00e 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Around_Field_With_Requirement_With_Other_Field.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Around_Field_With_Requirement_With_Other_Field.yaml @@ -28,11 +28,11 @@ sourceSchemas: schema { query: Query } - - type Product { + + type Product @key(fields: "id") { id: ID! } - + type Query { productBySlug(slug: String!): Product } @@ -65,29 +65,29 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! size: Int! } - + type Query { - productById(id: ID!): Product @lookup + productById(id: ID!): Product @lookup @shareable } - name: C schema: | schema { query: Query } - + type Product { id: ID! dimension(size: Int! @require(field: "size")): String price: Int! } - + type Query { - productById(id: ID!): Product @lookup + productById(id: ID!): Product @lookup @shareable } operationPlan: operation: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Around_Fields_Fetched_Through_Lookup.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Around_Fields_Fetched_Through_Lookup.yaml index c7915ad7c5c..f00d09f5b21 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Around_Fields_Fetched_Through_Lookup.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Around_Fields_Fetched_Through_Lookup.yaml @@ -34,18 +34,18 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! name: String! review: Review } - + type Query { productBySlug(slug: String!): Product } - - type Review { + + type Review @key(fields: "id") { id: ID! } interactions: @@ -83,11 +83,11 @@ sourceSchemas: schema { query: Query } - + type Query { reviewById(id: ID!): Review @lookup } - + type Review { id: ID! title: String! diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Not_Only_On_Field_With_Requirement.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Not_Only_On_Field_With_Requirement.yaml index 0bdf8f532a6..cf959c35239 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Not_Only_On_Field_With_Requirement.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Not_Only_On_Field_With_Requirement.yaml @@ -28,11 +28,11 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! } - + type Query { productBySlug(slug: String!): Product } @@ -59,12 +59,12 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! size: Int! } - + type Query { productById(id: ID!): Product @lookup } @@ -97,13 +97,13 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! dimension(size: Int! @require(field: "size")): String price: Int! } - + type Query { productById(id: ID!): Product @lookup } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Field_Fetched_Through_Lookup.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Field_Fetched_Through_Lookup.yaml index 0af4b91a00e..34cca066690 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Field_Fetched_Through_Lookup.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Field_Fetched_Through_Lookup.yaml @@ -31,18 +31,18 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! name: String! review: Review } - + type Query { productBySlug(slug: String!): Product } - - type Review { + + type Review @key(fields: "id") { id: ID! } interactions: @@ -74,11 +74,11 @@ sourceSchemas: schema { query: Query } - + type Query { reviewById(id: ID!): Review @lookup } - + type Review { id: ID! title: String! diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Field_With_Requirement.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Field_With_Requirement.yaml index e3a464fa6d8..e9e39d91422 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Field_With_Requirement.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Field_With_Requirement.yaml @@ -25,11 +25,11 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! } - + type Query { productBySlug(slug: String!): Product } @@ -56,12 +56,12 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! size: Int! } - + type Query { productById(id: ID!): Product @lookup } @@ -94,12 +94,12 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! dimension(size: Int! @require(field: "size")): String } - + type Query { productById(id: ID!): Product @lookup } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Parent_Field_Of_Field_Fetched_Through_Lookup.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Parent_Field_Of_Field_Fetched_Through_Lookup.yaml index 6f8eedfd322..b34cb21b125 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Parent_Field_Of_Field_Fetched_Through_Lookup.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_On_Parent_Field_Of_Field_Fetched_Through_Lookup.yaml @@ -30,18 +30,18 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! name: String! review: Review } - + type Query { productBySlug(slug: String!): Product } - - type Review { + + type Review @key(fields: "id") { id: ID! } interactions: @@ -76,11 +76,11 @@ sourceSchemas: schema { query: Query } - + type Query { reviewById(id: ID!): Review @lookup } - + type Review { id: ID! title: String! diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Only_On_Some_Fields_Fetched_Through_Lookup.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Only_On_Some_Fields_Fetched_Through_Lookup.yaml index 9c65a6c49f8..2e013034909 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Only_On_Some_Fields_Fetched_Through_Lookup.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Lookup_Skip_Only_On_Some_Fields_Fetched_Through_Lookup.yaml @@ -34,18 +34,18 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! name: String! review: Review } - + type Query { productBySlug(slug: String!): Product } - - type Review { + + type Review @key(fields: "id") { id: ID! } interactions: @@ -77,11 +77,11 @@ sourceSchemas: schema { query: Query } - + type Query { reviewById(id: ID!): Review @lookup } - + type Review { id: ID! title: String! diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Multiple_Skip_Levels_Around_NodeField.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Multiple_Skip_Levels_Around_NodeField.yaml index d1fe2fefe21..132598f529c 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Multiple_Skip_Levels_Around_NodeField.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Multiple_Skip_Levels_Around_NodeField.yaml @@ -30,16 +30,16 @@ sourceSchemas: schema { query: Query } - + interface Node { id: ID! } - + type Discussion implements Node { id: ID! title: String } - + type Query { node(id: ID!): Node @lookup } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Interface_Type_Refinement.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Interface_Type_Refinement.yaml index 9fea58ed864..8014bbfd5da 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Interface_Type_Refinement.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Interface_Type_Refinement.yaml @@ -35,27 +35,27 @@ sourceSchemas: schema { query: Query } - + interface Node { id: ID! } - + interface Votable { viewerCanVote: Boolean! } - + type Author implements Node & Votable { id: ID! username: String viewerCanVote: Boolean! } - + type Discussion implements Node & Votable { id: ID! title: String viewerCanVote: Boolean! } - + type Query { node(id: ID!): Node @lookup } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Multiple_Type_Refinements.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Multiple_Type_Refinements.yaml index e3b3e31a5d0..625909c9d11 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Multiple_Type_Refinements.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Multiple_Type_Refinements.yaml @@ -32,18 +32,18 @@ sourceSchemas: schema { query: Query } - + interface Node { id: ID! } - + type Discussion implements Node { id: ID! title: String } - + type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interactions: - request: @@ -80,18 +80,18 @@ sourceSchemas: schema { query: Query } - + interface Node { id: ID! } - + type Author implements Node { id: ID! username: String } - + type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } operationPlan: operation: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_NodeField.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_NodeField.yaml index c6d88c536a4..a35739a293c 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_NodeField.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_NodeField.yaml @@ -26,16 +26,16 @@ sourceSchemas: schema { query: Query } - + interface Node { id: ID! } - + type Discussion implements Node { id: ID! title: String } - + type Query { node(id: ID!): Node @lookup } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Shared_Selections.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Shared_Selections.yaml index 421bde24e1b..dc4d2b1cd86 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Shared_Selections.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_Around_Shared_Selections.yaml @@ -32,18 +32,18 @@ sourceSchemas: schema { query: Query } - + interface Node { id: ID! } - + type Discussion implements Node { id: ID! title: String } - + type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interactions: - request: @@ -80,18 +80,18 @@ sourceSchemas: schema { query: Query } - + interface Node { id: ID! } - + type Author implements Node { id: ID! username: String } - + type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } operationPlan: operation: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Selection.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Selection.yaml index 6d7285f7c31..c4b8a8f2cfe 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Selection.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Selection.yaml @@ -34,25 +34,25 @@ sourceSchemas: schema { query: Query } - + interface Authorable { author: Author } - + interface Node { id: ID! } - + type Author implements Node { id: ID! } - + type Discussion implements Node & Authorable { id: ID! title: String author: Author } - + type Query { node(id: ID!): Node @lookup } @@ -93,13 +93,13 @@ sourceSchemas: schema { query: Query } - + type Author { id: ID! username: String rating: Int } - + type Query { authorById(id: ID!): Author @lookup } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Selection_Type_Refinement_With_Same_Unskipped_Selection.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Selection_Type_Refinement_With_Same_Unskipped_Selection.yaml index ab3428d9b48..2cb1f5ed2b9 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Selection_Type_Refinement_With_Same_Unskipped_Selection.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Selection_Type_Refinement_With_Same_Unskipped_Selection.yaml @@ -34,24 +34,24 @@ sourceSchemas: schema { query: Query } - + interface Authorable { author: Author } - + interface Node { id: ID! } - + type Author implements Node { id: ID! } - + type Discussion implements Node & Authorable { id: ID! author: Author } - + type Query { node(id: ID!): Node @lookup } @@ -96,13 +96,13 @@ sourceSchemas: schema { query: Query } - + type Author { id: ID! username: String rating: Int } - + type Query { authorById(id: ID!): Author @lookup } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Type_Refinement.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Type_Refinement.yaml index cc792c8e2fb..0173b6df66f 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Type_Refinement.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Interface_Type_Refinement.yaml @@ -27,26 +27,26 @@ sourceSchemas: schema { query: Query } - + interface Node { id: ID! } - + interface Votable { viewerCanVote: Boolean! } - + type Author implements Node & Votable { id: ID! viewerCanVote: Boolean! } - + type Discussion implements Node & Votable { id: ID! title: String viewerCanVote: Boolean! } - + type Query { node(id: ID!): Node @lookup } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_NodeField.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_NodeField.yaml index f23224c21f9..bf9aad7cc92 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_NodeField.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_NodeField.yaml @@ -23,16 +23,16 @@ sourceSchemas: schema { query: Query } - + interface Node { id: ID! } - + type Discussion implements Node { id: ID! title: String } - + type Query { node(id: ID!): Node @lookup } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Selection_In_Type_Refinement.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Selection_In_Type_Refinement.yaml index 46407674795..cc9e31ee119 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Selection_In_Type_Refinement.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Selection_In_Type_Refinement.yaml @@ -30,16 +30,16 @@ sourceSchemas: schema { query: Query } - + interface Node { id: ID! } - + type Discussion implements Node { id: ID! title: String } - + type Query { node(id: ID!): Node @lookup } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Shared_Selection.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Shared_Selection.yaml index 4389eada585..8bbacb98616 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Shared_Selection.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Shared_Selection.yaml @@ -30,18 +30,18 @@ sourceSchemas: schema { query: Query } - + interface Node { id: ID! } - + type Discussion implements Node { id: ID! title: String } - + type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interactions: - request: @@ -78,18 +78,18 @@ sourceSchemas: schema { query: Query } - + interface Node { id: ID! } - + type Author implements Node { id: ID! username: String } - + type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } operationPlan: operation: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Type_Refinement.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Type_Refinement.yaml index 4f853e754eb..0c6265e00cc 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Type_Refinement.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.NodeField_Skip_On_Type_Refinement.yaml @@ -30,16 +30,16 @@ sourceSchemas: schema { query: Query } - + interface Node { id: ID! } - + type Discussion implements Node { id: ID! title: String } - + type Query { node(id: ID!): Node @lookup } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Multiple_Skip_Levels_Around_Fields_From_Different_Source_Schemas.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Multiple_Skip_Levels_Around_Fields_From_Different_Source_Schemas.yaml index 1cb7c8cb436..36e5f1b130e 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Multiple_Skip_Levels_Around_Fields_From_Different_Source_Schemas.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Multiple_Skip_Levels_Around_Fields_From_Different_Source_Schemas.yaml @@ -32,12 +32,12 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! name: String! } - + type Query { productBySlug(slug: String!): Product } @@ -46,11 +46,11 @@ sourceSchemas: schema { query: Query } - + type Query { viewer: Viewer } - + type Viewer { name: String! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Around_Fields_From_Different_Source_Schemas.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Around_Fields_From_Different_Source_Schemas.yaml index 1a6d3dba42f..f947c19f7f3 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Around_Fields_From_Different_Source_Schemas.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Around_Fields_From_Different_Source_Schemas.yaml @@ -28,12 +28,12 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! name: String! } - + type Query { productBySlug(slug: String!): Product } @@ -42,11 +42,11 @@ sourceSchemas: schema { query: Query } - + type Query { viewer: Viewer } - + type Viewer { name: String! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Around_Fields_Of_Same_Source_Schema.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Around_Fields_Of_Same_Source_Schema.yaml index 00960e314cd..b6a286b80e6 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Around_Fields_Of_Same_Source_Schema.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Around_Fields_Of_Same_Source_Schema.yaml @@ -28,17 +28,17 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! name: String! } - + type Query { productBySlug(slug: String!): Product viewer: Viewer } - + type Viewer { name: String! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_On_Field.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_On_Field.yaml index cf7534eaf56..89452f63194 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_On_Field.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_On_Field.yaml @@ -23,12 +23,12 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! name: String! } - + type Query { productBySlug(slug: String!): Product } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Only_On_Some_Fields_From_Different_Source_Schemas.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Only_On_Some_Fields_From_Different_Source_Schemas.yaml index 4a2ba0c3493..f0c70dec0b2 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Only_On_Some_Fields_From_Different_Source_Schemas.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Only_On_Some_Fields_From_Different_Source_Schemas.yaml @@ -30,12 +30,12 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! name: String! } - + type Query { productBySlug(slug: String!): Product } @@ -44,11 +44,11 @@ sourceSchemas: schema { query: Query } - + type Query { viewer: Viewer } - + type Viewer { name: String! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Only_On_Some_Fields_Of_Same_Source_Schema.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Only_On_Some_Fields_Of_Same_Source_Schema.yaml index 41b3510e402..cee77b84b0b 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Only_On_Some_Fields_Of_Same_Source_Schema.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.Root_Skip_Only_On_Some_Fields_Of_Same_Source_Schema.yaml @@ -30,17 +30,17 @@ sourceSchemas: schema { query: Query } - + type Product { id: ID! name: String! } - + type Query { productBySlug(slug: String!): Product viewer: Viewer } - + type Viewer { name: String! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.SharedPath_Multiple_Skip_Levels_Around_Entry_Field.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.SharedPath_Multiple_Skip_Levels_Around_Entry_Field.yaml index 79592f19a73..22c946c8c80 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.SharedPath_Multiple_Skip_Levels_Around_Entry_Field.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.SharedPath_Multiple_Skip_Levels_Around_Entry_Field.yaml @@ -34,11 +34,11 @@ sourceSchemas: schema { query: Query } - + type Query { viewer: Viewer } - + type Viewer { fieldA: String! } @@ -47,11 +47,11 @@ sourceSchemas: schema { query: Query } - + type Query { viewer: Viewer } - + type Viewer { fieldB: String! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.SharedPath_Multiple_Skip_Levels_Around_Fields_Below_Entry_Field.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.SharedPath_Multiple_Skip_Levels_Around_Fields_Below_Entry_Field.yaml index ca70fc9e998..d281f7d8648 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.SharedPath_Multiple_Skip_Levels_Around_Fields_Below_Entry_Field.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.SharedPath_Multiple_Skip_Levels_Around_Fields_Below_Entry_Field.yaml @@ -32,11 +32,11 @@ sourceSchemas: schema { query: Query } - + type Query { viewer: Viewer } - + type Viewer { fieldA: String! } @@ -73,11 +73,11 @@ sourceSchemas: schema { query: Query } - + type Query { viewer: Viewer } - + type Viewer { fieldB: String! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.SharedPath_Skip_On_Entry_Field.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.SharedPath_Skip_On_Entry_Field.yaml index 89f00be4b21..5bdeb58681e 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.SharedPath_Skip_On_Entry_Field.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.SharedPath_Skip_On_Entry_Field.yaml @@ -24,11 +24,11 @@ sourceSchemas: schema { query: Query } - + type Query { - viewer: Viewer + viewer: Viewer @shareable } - + type Viewer { fieldA: String! } @@ -37,11 +37,11 @@ sourceSchemas: schema { query: Query } - + type Query { - viewer: Viewer + viewer: Viewer @shareable } - + type Viewer { fieldB: String! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.SharedPath_Skip_On_Field_Below_Entry_Field.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.SharedPath_Skip_On_Field_Below_Entry_Field.yaml index 4c203cd0697..34a95771716 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.SharedPath_Skip_On_Field_Below_Entry_Field.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/ConditionalTests.SharedPath_Skip_On_Field_Below_Entry_Field.yaml @@ -28,11 +28,11 @@ sourceSchemas: schema { query: Query } - + type Query { - viewer: Viewer + viewer: Viewer @shareable } - + type Viewer { fieldA: String! } @@ -59,11 +59,11 @@ sourceSchemas: schema { query: Query } - + type Query { - viewer: Viewer + viewer: Viewer @shareable } - + type Viewer { fieldB: String! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Concrete_Type_Branch_Requested.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Concrete_Type_Branch_Requested.yaml index d65e6b8281b..3bb1ad19005 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Concrete_Type_Branch_Requested.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Concrete_Type_Branch_Requested.yaml @@ -36,7 +36,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } interactions: @@ -82,7 +82,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(id: ID!): Discussion @lookup @internal } interactions: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Concrete_Type_Branch_Requested_Abstract_Lookup.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Concrete_Type_Branch_Requested_Abstract_Lookup.yaml index 6f22475788e..63d9f5a19b3 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Concrete_Type_Branch_Requested_Abstract_Lookup.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Concrete_Type_Branch_Requested_Abstract_Lookup.yaml @@ -36,7 +36,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } - name: B @@ -60,7 +60,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(id: ID!): Discussion @lookup @internal } interactions: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Id_Of_Type_Different_From_Concrete_Type_Selections_Requested.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Id_Of_Type_Different_From_Concrete_Type_Selections_Requested.yaml index 1a2c4e521b6..d2ddc222399 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Id_Of_Type_Different_From_Concrete_Type_Selections_Requested.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Id_Of_Type_Different_From_Concrete_Type_Selections_Requested.yaml @@ -35,7 +35,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } - name: B @@ -59,7 +59,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(id: ID!): Discussion @lookup @internal } interactions: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Id_Of_Unknown_Type_Requested.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Id_Of_Unknown_Type_Requested.yaml index dfe5ee99ee2..e74108873b5 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Id_Of_Unknown_Type_Requested.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Id_Of_Unknown_Type_Requested.yaml @@ -43,7 +43,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } - name: B @@ -67,7 +67,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(id: ID!): Discussion @lookup @internal } operationPlan: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Invalid_Id_Requested.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Invalid_Id_Requested.yaml index 58d37b082e9..d247e64c2c6 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Invalid_Id_Requested.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Invalid_Id_Requested.yaml @@ -43,7 +43,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } - name: B @@ -67,7 +67,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(id: ID!): Discussion @lookup @internal } operationPlan: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.No_By_Id_Lookup_On_Best_Matching_Source_Schema.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.No_By_Id_Lookup_On_Best_Matching_Source_Schema.yaml index e1155c1700e..7f55792f76c 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.No_By_Id_Lookup_On_Best_Matching_Source_Schema.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.No_By_Id_Lookup_On_Best_Matching_Source_Schema.yaml @@ -24,7 +24,7 @@ sourceSchemas: query: Query } - type Discussion { + type Discussion @key(fields: "id") { id: ID! title: String! commentCount: Int! @@ -67,7 +67,7 @@ sourceSchemas: id: ID! } - type Discussion implements Node { + type Discussion implements Node @key(fields: "title") { id: ID! title: String! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Concrete_Type_Has_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Concrete_Type_Has_Dependency.yaml index 65360d65171..11fe3f7b663 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Concrete_Type_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Concrete_Type_Has_Dependency.yaml @@ -81,7 +81,7 @@ sourceSchemas: query: Query } - interface Node { + interface Node @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Concrete_Type_Selection_Has_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Concrete_Type_Selection_Has_Dependency.yaml index 9fff4654a70..81d77f9f890 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Concrete_Type_Selection_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Concrete_Type_Selection_Has_Dependency.yaml @@ -48,12 +48,12 @@ sourceSchemas: product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(id: ID!): Discussion @lookup } interactions: @@ -106,7 +106,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interactions: - request: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_And_Concrete_Type_Both_Have_Different_Dependencies.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_And_Concrete_Type_Both_Have_Different_Dependencies.yaml index af4ff10a9b4..8538cfc0c9e 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_And_Concrete_Type_Both_Have_Different_Dependencies.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_And_Concrete_Type_Both_Have_Different_Dependencies.yaml @@ -82,7 +82,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interactions: - request: @@ -149,7 +149,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interactions: - request: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_Selection_Has_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_Selection_Has_Dependency.yaml index fe0e9c440dd..1fe3c4b6d09 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_Selection_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Selections_On_Interface_Selection_Has_Dependency.yaml @@ -69,7 +69,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interactions: - request: @@ -130,7 +130,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interactions: - request: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Two_Concrete_Types_Selections_Have_Different_Dependencies.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Two_Concrete_Types_Selections_Have_Different_Dependencies.yaml index 8b1afc63754..a6367adada0 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Two_Concrete_Types_Selections_Have_Different_Dependencies.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Two_Concrete_Types_Selections_Have_Different_Dependencies.yaml @@ -50,12 +50,12 @@ sourceSchemas: product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interactions: - request: @@ -100,12 +100,12 @@ sourceSchemas: id: ID! } - type Product { + type Product @key(fields: "id") { id: ID! } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } type Review implements Node { @@ -128,7 +128,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interactions: - request: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Two_Concrete_Types_Selections_Have_Same_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Two_Concrete_Types_Selections_Have_Same_Dependency.yaml index 012c73457ef..988cb74b2ab 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Two_Concrete_Types_Selections_Have_Same_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Node_Field_Two_Concrete_Types_Selections_Have_Same_Dependency.yaml @@ -48,12 +48,12 @@ sourceSchemas: product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interactions: - request: @@ -98,12 +98,12 @@ sourceSchemas: id: ID! } - type Product { + type Product @key(fields: "id") { id: ID! } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } type Review implements Node { @@ -126,7 +126,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interactions: - request: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_TypeName_Selected_On_Concrete_Type.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_TypeName_Selected_On_Concrete_Type.yaml index 7a711f80bf1..16de3d986db 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_TypeName_Selected_On_Concrete_Type.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_TypeName_Selected_On_Concrete_Type.yaml @@ -34,7 +34,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } interactions: @@ -71,7 +71,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(id: ID!): Discussion @lookup @internal } operationPlan: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_Typename_Selected.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_Typename_Selected.yaml index cfb8d33f99d..a786d5b2647 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_Typename_Selected.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Only_Typename_Selected.yaml @@ -38,7 +38,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } interactions: - request: @@ -81,7 +81,7 @@ sourceSchemas: type Query { authorById(id: ID!): Author @lookup - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable } operationPlan: operation: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Two_Node_Fields_With_Alias.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Two_Node_Fields_With_Alias.yaml index 4342b5dfc34..8f03a5d68f0 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Two_Node_Fields_With_Alias.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/GlobalObjectIdentificationTests.Two_Node_Fields_With_Alias.yaml @@ -44,7 +44,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussionById(discussionId: ID! @is(field: "id")): Discussion @lookup } interactions: @@ -104,7 +104,7 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable discussion(id: ID!): Discussion @lookup } interactions: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type_Linked_Field_With_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type_Linked_Field_With_Dependency.yaml index 53625b5f85a..8a70f05ba55 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type_Linked_Field_With_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type_Linked_Field_With_Dependency.yaml @@ -34,7 +34,7 @@ sourceSchemas: viewerCanVote: Boolean! } - type Author { + type Author @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type_With_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type_With_Dependency.yaml index 677ee21cee3..77bec2d70ee 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type_With_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Concrete_Type_With_Dependency.yaml @@ -42,7 +42,7 @@ sourceSchemas: type Query { votable: Votable - discussionById(id: ID!): Discussion @lookup + discussionById(id: ID!): Discussion @lookup @shareable } interactions: - request: @@ -80,7 +80,7 @@ sourceSchemas: } type Query { - discussionById(id: ID!): Discussion @lookup + discussionById(id: ID!): Discussion @lookup @shareable } interactions: - request: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency.yaml index 347b1958af9..92a4dbebc5e 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency.yaml @@ -32,7 +32,7 @@ sourceSchemas: author: Author } - type Author { + type Author @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml index 84902212cc0..7bc067e75e8 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml @@ -38,7 +38,7 @@ sourceSchemas: author: Author } - type Author { + type Author @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml index 7f832df3d64..6d272e96c84 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_Field_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml @@ -38,7 +38,7 @@ sourceSchemas: author: Author } - type Author { + type Author @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type_Linked_Field_With_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type_Linked_Field_With_Dependency.yaml index 07271bbf9c6..805ce87ee6a 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type_Linked_Field_With_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type_Linked_Field_With_Dependency.yaml @@ -45,7 +45,7 @@ sourceSchemas: viewerCanVote: Boolean! } - type Author { + type Author @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type_With_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type_With_Dependency.yaml index 1de734ce664..b8a1b813dbd 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type_With_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Concrete_Type_With_Dependency.yaml @@ -51,7 +51,7 @@ sourceSchemas: type Query { votables: [Votable] - discussionById(id: ID!): Discussion @lookup + discussionById(id: ID!): Discussion @lookup @shareable } interactions: - request: @@ -100,7 +100,7 @@ sourceSchemas: } type Query { - discussionById(id: ID!): Discussion @lookup + discussionById(id: ID!): Discussion @lookup @shareable } interactions: - request: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency.yaml index ab48dd1d7a9..b444a8119d2 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency.yaml @@ -46,7 +46,7 @@ sourceSchemas: author: Author } - type Author { + type Author @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml index 30dc37275e2..b0f4d79dde5 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml @@ -53,7 +53,7 @@ sourceSchemas: author: Author } - type Author { + type Author @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml index bee20c04043..49916453714 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.Interface_List_Field_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml @@ -52,7 +52,7 @@ sourceSchemas: author: Author } - type Author { + type Author @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type_Linked_Field_With_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type_Linked_Field_With_Dependency.yaml index ae7b6313eb4..131de8a70e8 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type_Linked_Field_With_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type_Linked_Field_With_Dependency.yaml @@ -56,7 +56,7 @@ sourceSchemas: viewerCanVote: Boolean! } - type Author { + type Author @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type_With_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type_With_Dependency.yaml index 0d454019e3a..6a5401b7b81 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type_With_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Concrete_Type_With_Dependency.yaml @@ -60,7 +60,7 @@ sourceSchemas: type Query { wrappers: [Wrapper] - discussionById(id: ID!): Discussion @lookup + discussionById(id: ID!): Discussion @lookup @shareable } type Wrapper { @@ -122,7 +122,7 @@ sourceSchemas: } type Query { - discussionById(id: ID!): Discussion @lookup + discussionById(id: ID!): Discussion @lookup @shareable } interactions: - request: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency.yaml index 5871414cbe4..67fa0938b7c 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency.yaml @@ -50,7 +50,7 @@ sourceSchemas: author: Author } - type Author { + type Author @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml index d9d22b10f0a..1a09f3f300c 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency_Different_Selection_In_Concrete_Type.yaml @@ -58,7 +58,7 @@ sourceSchemas: author: Author } - type Author { + type Author @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml index 8d6ac5ac76b..8bec0499b33 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/InterfaceTests.List_Field_Interface_Object_Property_Linked_Field_With_Dependency_Same_Selection_In_Concrete_Type.yaml @@ -55,7 +55,7 @@ sourceSchemas: author: Author } - type Author { + type Author @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/MutationTests.Multiple_Mutation.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/MutationTests.Multiple_Mutation.yaml index 50c78f93575..0a4072c2108 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/MutationTests.Multiple_Mutation.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/MutationTests.Multiple_Mutation.yaml @@ -43,7 +43,7 @@ sourceSchemas: mutation: Mutation } - type Book { + type Book @key(fields: "id") { id: Int! title: String! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/MutationTests.Single_Mutation.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/MutationTests.Single_Mutation.yaml index 584cb657b95..9feca213128 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/MutationTests.Single_Mutation.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/MutationTests.Single_Mutation.yaml @@ -29,7 +29,7 @@ sourceSchemas: mutation: Mutation } - type Book { + type Book @key(fields: "id") { id: Int! title: String! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Require_Enumerable_In_List.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Require_Enumerable_In_List.yaml index 27ec71b041a..2fb91623943 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Require_Enumerable_In_List.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Require_Enumerable_In_List.yaml @@ -101,7 +101,7 @@ sourceSchemas: type Query { books("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): BooksConnection - book(id: Int!): Book @lookup + book(id: Int!): Book @lookup @shareable } interactions: - request: @@ -166,7 +166,7 @@ sourceSchemas: } type Query { - book(id: Int!): Book @lookup + book(id: Int!): Book @lookup @shareable } - name: c schema: | @@ -180,7 +180,7 @@ sourceSchemas: } type Query { - book(id: Int!): Book @lookup + book(id: Int!): Book @lookup @shareable } input BookDimensionInput { @@ -205,7 +205,7 @@ sourceSchemas: } type Query { - book(id: Int!): Book @lookup + book(id: Int!): Book @lookup @shareable } interactions: - request: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Require_Object_In_A_List.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Require_Object_In_A_List.yaml index 3b1af6e5f46..15dd7da8e27 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Require_Object_In_A_List.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/RequireTests.Require_Object_In_A_List.yaml @@ -81,7 +81,7 @@ sourceSchemas: type Query { books("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): BooksConnection - book(id: Int!): Book @lookup + book(id: Int!): Book @lookup @shareable } interactions: - request: @@ -134,7 +134,7 @@ sourceSchemas: } type Query { - book(id: Int!): Book @lookup + book(id: Int!): Book @lookup @shareable } interactions: - request: @@ -208,7 +208,7 @@ sourceSchemas: } type Query { - book(id: Int!): Book @lookup + book(id: Int!): Book @lookup @shareable } input BookDimensionInput { @@ -297,7 +297,7 @@ sourceSchemas: } type Query { - book(id: Int!): Book @lookup + book(id: Int!): Book @lookup @shareable } operationPlan: operation: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup.yaml index 003ce7cc41c..da03cf491e0 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup.yaml @@ -32,24 +32,24 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema1: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { productById(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema1: String! - interface: IInterface! + interface: IInterface! @shareable unsharedInterface: IInterface! - union: IUnion! - topReview: Review! + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -59,7 +59,7 @@ sourceSchemas: type SharedProduct { schema1: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -68,7 +68,7 @@ sourceSchemas: type Viewer { schema1: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { @@ -110,23 +110,23 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema2: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { product(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema2: String! - interface: IInterface! - union: IUnion! - topReview: Review! + interface: IInterface! @shareable + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -136,7 +136,7 @@ sourceSchemas: type SharedProduct { schema2: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -145,7 +145,7 @@ sourceSchemas: type Viewer { schema2: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Level.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Level.yaml index 4f08c8db4d2..344dd2e8aa3 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Level.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Level.yaml @@ -36,24 +36,24 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema1: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { productById(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema1: String! - interface: IInterface! + interface: IInterface! @shareable unsharedInterface: IInterface! - union: IUnion! - topReview: Review! + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -63,7 +63,7 @@ sourceSchemas: type SharedProduct { schema1: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -72,7 +72,7 @@ sourceSchemas: type Viewer { schema1: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { @@ -116,23 +116,23 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema2: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { product(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema2: String! - interface: IInterface! - union: IUnion! - topReview: Review! + interface: IInterface! @shareable + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -142,7 +142,7 @@ sourceSchemas: type SharedProduct { schema2: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -151,7 +151,7 @@ sourceSchemas: type Viewer { schema2: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Levels.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Levels.yaml index 90b5558db31..f93f9e1ff24 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Levels.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Parent_Fields_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Levels.yaml @@ -40,24 +40,24 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema1: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { productById(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema1: String! - interface: IInterface! + interface: IInterface! @shareable unsharedInterface: IInterface! - union: IUnion! - topReview: Review! + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -67,7 +67,7 @@ sourceSchemas: type SharedProduct { schema1: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -76,7 +76,7 @@ sourceSchemas: type Viewer { schema1: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { @@ -122,23 +122,23 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema2: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { product(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema2: String! - interface: IInterface! - union: IUnion! - topReview: Review! + interface: IInterface! @shareable + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -148,7 +148,7 @@ sourceSchemas: type SharedProduct { schema2: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -157,7 +157,7 @@ sourceSchemas: type Viewer { schema2: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Root_Fields.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Root_Fields.yaml index 3332c52e85f..c43db464b7e 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Root_Fields.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Root_Fields.yaml @@ -28,24 +28,24 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema1: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { productById(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema1: String! - interface: IInterface! + interface: IInterface! @shareable unsharedInterface: IInterface! - union: IUnion! - topReview: Review! + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -55,7 +55,7 @@ sourceSchemas: type SharedProduct { schema1: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -64,7 +64,7 @@ sourceSchemas: type Viewer { schema1: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { @@ -100,23 +100,23 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema2: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { product(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema2: String! - interface: IInterface! - union: IUnion! - topReview: Review! + interface: IInterface! @shareable + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -126,7 +126,7 @@ sourceSchemas: type SharedProduct { schema2: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -135,7 +135,7 @@ sourceSchemas: type Viewer { schema2: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Root_Fields_With_Extra_Fields_On_Shared_Level.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Root_Fields_With_Extra_Fields_On_Shared_Level.yaml index a7396068fd0..79e5b9dfbb8 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Root_Fields_With_Extra_Fields_On_Shared_Level.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Hierarchy_Of_Shared_Root_Fields_With_Extra_Fields_On_Shared_Level.yaml @@ -34,24 +34,24 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema1: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { productById(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema1: String! - interface: IInterface! + interface: IInterface! @shareable unsharedInterface: IInterface! - union: IUnion! - topReview: Review! + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -61,7 +61,7 @@ sourceSchemas: type SharedProduct { schema1: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -70,7 +70,7 @@ sourceSchemas: type Viewer { schema1: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { @@ -123,23 +123,23 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema2: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { product(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema2: String! - interface: IInterface! - union: IUnion! - topReview: Review! + interface: IInterface! @shareable + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -149,7 +149,7 @@ sourceSchemas: type SharedProduct { schema2: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -158,7 +158,7 @@ sourceSchemas: type Viewer { schema2: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { @@ -197,7 +197,7 @@ sourceSchemas: } type Query { - viewer: Viewer! + viewer: Viewer! @shareable } type Viewer { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup.yaml index 4be831b85ea..48f89bb603d 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup.yaml @@ -28,24 +28,24 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema1: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { productById(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema1: String! - interface: IInterface! + interface: IInterface! @shareable unsharedInterface: IInterface! - union: IUnion! - topReview: Review! + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -55,7 +55,7 @@ sourceSchemas: type SharedProduct { schema1: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -64,7 +64,7 @@ sourceSchemas: type Viewer { schema1: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { @@ -102,23 +102,23 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema2: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { product(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema2: String! - interface: IInterface! - union: IUnion! - topReview: Review! + interface: IInterface! @shareable + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -128,7 +128,7 @@ sourceSchemas: type SharedProduct { schema2: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -137,7 +137,7 @@ sourceSchemas: type Viewer { schema2: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Level.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Level.yaml index c30d6492eb1..7f18e12a8b2 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Level.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup_With_Extra_Fields_On_Shared_Level.yaml @@ -32,24 +32,24 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema1: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { productById(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema1: String! - interface: IInterface! + interface: IInterface! @shareable unsharedInterface: IInterface! - union: IUnion! - topReview: Review! + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -59,7 +59,7 @@ sourceSchemas: type SharedProduct { schema1: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -68,7 +68,7 @@ sourceSchemas: type Viewer { schema1: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { @@ -108,23 +108,23 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema2: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { product(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema2: String! - interface: IInterface! - union: IUnion! - topReview: Review! + interface: IInterface! @shareable + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -134,7 +134,7 @@ sourceSchemas: type SharedProduct { schema2: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -143,7 +143,7 @@ sourceSchemas: type Viewer { schema2: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup_With_Type_Refinement.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup_With_Type_Refinement.yaml index da85f8cde6a..1657f8cee61 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup_With_Type_Refinement.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Shared_Parent_Field_Below_Type_With_Lookup_With_Type_Refinement.yaml @@ -30,24 +30,24 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema1: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { productById(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema1: String! - interface: IInterface! + interface: IInterface! @shareable unsharedInterface: IInterface! - union: IUnion! - topReview: Review! + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -57,7 +57,7 @@ sourceSchemas: type SharedProduct { schema1: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -66,7 +66,7 @@ sourceSchemas: type Viewer { schema1: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { @@ -108,23 +108,23 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema2: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { product(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema2: String! - interface: IInterface! - union: IUnion! - topReview: Review! + interface: IInterface! @shareable + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -134,7 +134,7 @@ sourceSchemas: type SharedProduct { schema2: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -143,7 +143,7 @@ sourceSchemas: type Viewer { schema2: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Interface_Root_Field_With_Type_Refinement.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Interface_Root_Field_With_Type_Refinement.yaml index 0e3eb3876d9..9ad06c62431 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Interface_Root_Field_With_Type_Refinement.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Interface_Root_Field_With_Type_Refinement.yaml @@ -26,24 +26,24 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema1: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { productById(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema1: String! - interface: IInterface! + interface: IInterface! @shareable unsharedInterface: IInterface! - union: IUnion! - topReview: Review! + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -53,7 +53,7 @@ sourceSchemas: type SharedProduct { schema1: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -62,7 +62,7 @@ sourceSchemas: type Viewer { schema1: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { @@ -98,23 +98,23 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema2: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { product(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema2: String! - interface: IInterface! - union: IUnion! - topReview: Review! + interface: IInterface! @shareable + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -124,7 +124,7 @@ sourceSchemas: type SharedProduct { schema2: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -133,7 +133,7 @@ sourceSchemas: type Viewer { schema2: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field.yaml index 11953d578e6..e1e406edd7a 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field.yaml @@ -24,24 +24,24 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema1: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { productById(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema1: String! - interface: IInterface! + interface: IInterface! @shareable unsharedInterface: IInterface! - union: IUnion! - topReview: Review! + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -51,7 +51,7 @@ sourceSchemas: type SharedProduct { schema1: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -60,7 +60,7 @@ sourceSchemas: type Viewer { schema1: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { @@ -92,23 +92,23 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema2: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { product(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema2: String! - interface: IInterface! - union: IUnion! - topReview: Review! + interface: IInterface! @shareable + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -118,7 +118,7 @@ sourceSchemas: type SharedProduct { schema2: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -127,7 +127,7 @@ sourceSchemas: type Viewer { schema2: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field_With_Extra_Fields_On_Root.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field_With_Extra_Fields_On_Root.yaml index 6e507b8b3c5..d75364d029c 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field_With_Extra_Fields_On_Root.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Root_Field_With_Extra_Fields_On_Root.yaml @@ -28,24 +28,24 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema1: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { productById(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema1: String! - interface: IInterface! + interface: IInterface! @shareable unsharedInterface: IInterface! - union: IUnion! - topReview: Review! + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -55,7 +55,7 @@ sourceSchemas: type SharedProduct { schema1: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -64,7 +64,7 @@ sourceSchemas: type Viewer { schema1: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { @@ -98,23 +98,23 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema2: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { product(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema2: String! - interface: IInterface! - union: IUnion! - topReview: Review! + interface: IInterface! @shareable + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -124,7 +124,7 @@ sourceSchemas: type SharedProduct { schema2: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -133,7 +133,7 @@ sourceSchemas: type Viewer { schema2: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Union_Root_Field_With_Type_Refinement.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Union_Root_Field_With_Type_Refinement.yaml index c43043c847e..54f7edd70e2 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Union_Root_Field_With_Type_Refinement.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SharedPathTests.Single_Shared_Union_Root_Field_With_Type_Refinement.yaml @@ -26,24 +26,24 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema1: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { productById(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema1: String! - interface: IInterface! + interface: IInterface! @shareable unsharedInterface: IInterface! - union: IUnion! - topReview: Review! + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -53,7 +53,7 @@ sourceSchemas: type SharedProduct { schema1: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -62,7 +62,7 @@ sourceSchemas: type Viewer { schema1: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { @@ -98,23 +98,23 @@ sourceSchemas: query: Query } - interface IInterface { + interface IInterface @key(fields: "id") { id: Int! } type Product implements IInterface { id: Int! schema2: String! - shared: SharedProduct + shared: SharedProduct @shareable } type Query { product(id: Int!): Product @lookup - viewer: Viewer! + viewer: Viewer! @shareable schema2: String! - interface: IInterface! - union: IUnion! - topReview: Review! + interface: IInterface! @shareable + union: IUnion! @shareable + topReview: Review! @shareable } type Review implements IInterface { @@ -124,7 +124,7 @@ sourceSchemas: type SharedProduct { schema2: String! - shared2: SharedProduct2 + shared2: SharedProduct2 @shareable } type SharedProduct2 { @@ -133,7 +133,7 @@ sourceSchemas: type Viewer { schema2: String! - settings: ViewerSettings! + settings: ViewerSettings! @shareable } type ViewerSettings { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SubscriptionsOverHttpStoreTests.Subscribe_Simple.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SubscriptionsOverHttpStoreTests.Subscribe_Simple.yaml index 7745dfe50a7..39dac76fef6 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SubscriptionsOverHttpStoreTests.Subscribe_Simple.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/SubscriptionsOverHttpStoreTests.Subscribe_Simple.yaml @@ -43,7 +43,7 @@ sourceSchemas: subscription: Subscription } - type Book { + type Book @key(fields: "id") { id: Int! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Has_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Has_Dependency.yaml index eaffdbdc324..075b2db3b4f 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Has_Dependency.yaml @@ -48,7 +48,7 @@ sourceSchemas: subgraph1: String } - type Photo { + type Photo @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selection_Has_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selection_Has_Dependency.yaml index 9e3387cb81b..99d127a4cee 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selection_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selection_Has_Dependency.yaml @@ -53,7 +53,7 @@ sourceSchemas: query: Query } - type Author { + type Author @key(fields: "id") { id: ID! } @@ -71,7 +71,7 @@ sourceSchemas: node: Post } - type Product { + type Product @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml index 8b76bc220de..06d53a6140c 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml @@ -53,7 +53,7 @@ sourceSchemas: query: Query } - type Author { + type Author @key(fields: "id") { id: ID! } @@ -71,7 +71,7 @@ sourceSchemas: node: Post } - type Product { + type Product @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selections_Have_Same_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selections_Have_Same_Dependency.yaml index f0f3393d089..377f5b68c23 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selections_Have_Same_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_Field_Concrete_Type_Selections_Have_Same_Dependency.yaml @@ -67,7 +67,7 @@ sourceSchemas: node: Post } - type Product { + type Product @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Has_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Has_Dependency.yaml index 4f68c61cb94..45f2410c33a 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Has_Dependency.yaml @@ -72,7 +72,7 @@ sourceSchemas: subgraph1: String } - type Photo { + type Photo @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selection_Has_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selection_Has_Dependency.yaml index 12c8fd183c8..07dbc797212 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selection_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selection_Has_Dependency.yaml @@ -89,7 +89,7 @@ sourceSchemas: query: Query } - type Author { + type Author @key(fields: "id") { id: ID! } @@ -103,7 +103,7 @@ sourceSchemas: product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml index f0f1b4e0029..a116a17e185 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml @@ -89,7 +89,7 @@ sourceSchemas: query: Query } - type Author { + type Author @key(fields: "id") { id: ID! } @@ -103,7 +103,7 @@ sourceSchemas: product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selections_Have_Same_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selections_Have_Same_Dependency.yaml index 70729defbaf..c70f45ec6df 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selections_Have_Same_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Object_List_Union_List_Concrete_Type_Selections_Have_Same_Dependency.yaml @@ -99,7 +99,7 @@ sourceSchemas: product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Has_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Has_Dependency.yaml index 43d6f585733..8b7aac38bf9 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Has_Dependency.yaml @@ -32,7 +32,7 @@ sourceSchemas: subgraph1: String } - type Photo { + type Photo @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selection_Has_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selection_Has_Dependency.yaml index 893021b8ff3..d33376b183d 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selection_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selection_Has_Dependency.yaml @@ -33,7 +33,7 @@ sourceSchemas: query: Query } - type Author { + type Author @key(fields: "id") { id: ID! } @@ -47,7 +47,7 @@ sourceSchemas: product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml index 493c37c9d56..42ddd8da7b2 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml @@ -33,7 +33,7 @@ sourceSchemas: query: Query } - type Author { + type Author @key(fields: "id") { id: ID! } @@ -47,7 +47,7 @@ sourceSchemas: product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selections_Have_Same_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selections_Have_Same_Dependency.yaml index 8730369200d..8b4236c9af1 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selections_Have_Same_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_Field_Concrete_Type_Selections_Have_Same_Dependency.yaml @@ -43,7 +43,7 @@ sourceSchemas: product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Has_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Has_Dependency.yaml index f939d7ade0e..87ec3e6faa3 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Has_Dependency.yaml @@ -40,7 +40,7 @@ sourceSchemas: subgraph1: String } - type Photo { + type Photo @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selection_Has_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selection_Has_Dependency.yaml index 5487aecc996..fe968620262 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selection_Has_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selection_Has_Dependency.yaml @@ -45,7 +45,7 @@ sourceSchemas: query: Query } - type Author { + type Author @key(fields: "id") { id: ID! } @@ -59,7 +59,7 @@ sourceSchemas: product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml index b277089f4b0..8259dfff105 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selections_Have_Dependency_To_Same_Subgraph.yaml @@ -45,7 +45,7 @@ sourceSchemas: query: Query } - type Author { + type Author @key(fields: "id") { id: ID! } @@ -59,7 +59,7 @@ sourceSchemas: product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selections_Have_Same_Dependency.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selections_Have_Same_Dependency.yaml index 440564077c9..9d19860802e 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selections_Have_Same_Dependency.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/__snapshots__/UnionTests.Union_List_Concrete_Type_Selections_Have_Same_Dependency.yaml @@ -55,7 +55,7 @@ sourceSchemas: product: Product } - type Product { + type Product @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/DemoIntegrationTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/DemoIntegrationTests.cs index cea2ab41ae3..ad8ca56b6b4 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/DemoIntegrationTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/DemoIntegrationTests.cs @@ -30,7 +30,7 @@ type Product implements Node { id: ID! } - interface Node { + interface Node @key(fields: "id") { id: ID! } """); @@ -2127,8 +2127,8 @@ public async Task BatchExecutionState_With_Multiple_Variable_Values() "A", """ type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } interface Node { @@ -2144,8 +2144,8 @@ type User implements Node { "B", """ type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable userBySlug(slug: String!): User } @@ -2162,8 +2162,8 @@ type User implements Node { "C", """ type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } interface Node { @@ -2239,8 +2239,8 @@ public async Task BatchExecutionState_With_Multiple_Variable_Values_Some_Items_N "A", """ type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } interface Node { @@ -2256,9 +2256,9 @@ type User implements Node { "B", """ type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable # TODO: This will not work like this - nodes(ids: [ID!]!): [Node]! @null(atIndex: 1) + nodes(ids: [ID!]!): [Node]! @null(atIndex: 1) @shareable userBySlug(slug: String!): User } @@ -2275,8 +2275,8 @@ type User implements Node { "C", """ type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } interface Node { @@ -2352,8 +2352,8 @@ public async Task BatchExecutionState_With_Multiple_Variable_Values_And_Forwarde "A", """ type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } interface Node { @@ -2369,8 +2369,8 @@ type User implements Node { "B", """ type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable userBySlug(slug: String!): User } @@ -2387,8 +2387,8 @@ type User implements Node { "C", """ type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } interface Node { @@ -2475,7 +2475,7 @@ type Product implements Node { type ProductAvailability implements Node { id: ID! - sharedLinked: ProductAvailabilityMail! + sharedLinked: ProductAvailabilityMail! @shareable } type ProductAvailabilityMail { @@ -2483,9 +2483,9 @@ type ProductAvailabilityMail { } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable productById(id: ID!): Product @lookup - productAvailabilityById(id: ID!): ProductAvailability @lookup + productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable } """); @@ -2498,7 +2498,7 @@ interface Node { type ProductAvailability implements Node { id: ID! - sharedLinked: ProductAvailabilityMail! + sharedLinked: ProductAvailabilityMail! @shareable } type ProductAvailabilityMail { @@ -2506,8 +2506,8 @@ type ProductAvailabilityMail { } type Query { - node("ID of the object." id: ID!): Node @lookup - productAvailabilityById(id: ID!): ProductAvailability @lookup + node("ID of the object." id: ID!): Node @lookup @shareable + productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable } """); @@ -2560,17 +2560,17 @@ type Product implements Node { type ProductAvailability implements Node { id: ID! - sharedLinked: ProductAvailabilityMail! + sharedLinked: ProductAvailabilityMail! @shareable } type ProductAvailabilityMail { - sharedScalar: String! + sharedScalar: String! @shareable } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable productById(id: ID!): Product @lookup - productAvailabilityById(id: ID!): ProductAvailability @lookup + productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable } """); @@ -2582,19 +2582,19 @@ interface Node { } type ProductAvailability implements Node { - sharedLinked: ProductAvailabilityMail! + sharedLinked: ProductAvailabilityMail! @shareable subgraph2Only: Boolean! id: ID! } type ProductAvailabilityMail { subgraph2Only: Boolean! - sharedScalar: String! + sharedScalar: String! @shareable } type Query { - node(id: ID!): Node @lookup - productAvailabilityById(id: ID!): ProductAvailability @lookup + node(id: ID!): Node @lookup @shareable + productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable } """); @@ -2649,19 +2649,19 @@ type Product implements Node { type ProductAvailability implements Node { id: ID! - sharedLinked: ProductAvailabilityMail! + sharedLinked: ProductAvailabilityMail! @shareable subgraph1Only: Boolean! } type ProductAvailabilityMail { - sharedScalar: String! + sharedScalar: String! @shareable subgraph1Only: String! } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable productById(id: ID!): Product @lookup - productAvailabilityById(id: ID!): ProductAvailability @lookup + productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable } """); @@ -2673,19 +2673,19 @@ interface Node { } type ProductAvailability implements Node { - sharedLinked: ProductAvailabilityMail! + sharedLinked: ProductAvailabilityMail! @shareable subgraph2Only: Boolean! id: ID! } type ProductAvailabilityMail { subgraph2Only: Boolean! - sharedScalar: String! + sharedScalar: String! @shareable } type Query { - node(id: ID!): Node @lookup - productAvailabilityById(id: ID!): ProductAvailability @lookup + node(id: ID!): Node @lookup @shareable + productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable } """); @@ -2733,7 +2733,7 @@ public async Task Viewer_Bug_1() """ type Query { exclusiveSubgraphA: ExclusiveSubgraphA - viewer: Viewer + viewer: Viewer @shareable } type ExclusiveSubgraphA { @@ -2749,7 +2749,7 @@ type Viewer { "B", """ type Query { - viewer: Viewer + viewer: Viewer @shareable } type Viewer { @@ -2795,7 +2795,7 @@ public async Task Viewer_Bug_2() """ type Query { exclusiveSubgraphA: ExclusiveSubgraphA - viewer: Viewer + viewer: Viewer @shareable } type ExclusiveSubgraphA { @@ -2803,7 +2803,7 @@ type ExclusiveSubgraphA { } type Viewer { - subType: SubType + subType: SubType @shareable } type SubType { @@ -2815,11 +2815,11 @@ type SubType { "B", """ type Query { - viewer: Viewer + viewer: Viewer @shareable } type Viewer { - subType: SubType + subType: SubType @shareable } type SubType { @@ -2866,7 +2866,7 @@ public async Task Viewer_Bug_3() "A", """ type Query { - viewer: Viewer! + viewer: Viewer! @shareable } type Viewer { @@ -2878,7 +2878,7 @@ type Viewer { "B", """ type Query { - viewer: Viewer! + viewer: Viewer! @shareable } type Viewer { @@ -2990,7 +2990,7 @@ type Product implements Node { id: ID! } - interface Node { + interface Node @key(fields: "id") { id: ID! } """); @@ -3006,9 +3006,9 @@ type Test { id: ID! } - type Product { + type Product @key(fields: "id") { id: ID! - name: String! + name: String! @shareable } """); @@ -3021,7 +3021,7 @@ type Query { type Product implements Node { id: ID! - name: String! + name: String! @shareable } interface Node { @@ -3070,7 +3070,7 @@ type Query { productBySlug: Product } - type Product { + type Product @key(fields: "id") { id: ID! } """); @@ -3079,16 +3079,16 @@ type Product { "B", """ type Query { - productById(id: ID!): Product @lookup + productById(id: ID!): Product @lookup @shareable } type Product { id: ID! - author: Author + author: Author @shareable } type Author { - name: String! + name: String! @shareable } """); @@ -3096,16 +3096,16 @@ type Author { "C", """ type Query { - productById(id: ID!): Product @lookup + productById(id: ID!): Product @lookup @shareable } type Product { id: ID! - author: Author + author: Author @shareable } type Author { - name: String! + name: String! @shareable rating: Int! } """); diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/SubgraphErrorTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/SubgraphErrorTests.cs index ed87a9b8890..e9400628188 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/SubgraphErrorTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/SubgraphErrorTests.cs @@ -2352,7 +2352,7 @@ type Product { brand: Brand } - type Brand { + type Brand @key(fields: "id") { id: ID! } """); @@ -2416,7 +2416,7 @@ type Product { brand: Brand } - type Brand { + type Brand @key(fields: "id") { id: ID! } """); @@ -2480,7 +2480,7 @@ type Product { brand: Brand! } - type Brand { + type Brand @key(fields: "id") { id: ID! } """); @@ -2544,7 +2544,7 @@ type Product { brand: Brand } - type Brand { + type Brand @key(fields: "id") { id: ID! } """); @@ -2608,7 +2608,7 @@ type Product { brand: Brand } - type Brand { + type Brand @key(fields: "id") { id: ID! } """); @@ -2672,7 +2672,7 @@ type Product { brand: Brand! } - type Brand { + type Brand @key(fields: "id") { id: ID! } """); diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/TransportErrorTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/TransportErrorTests.cs index 7957082adbc..39853f29acf 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/TransportErrorTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/TransportErrorTests.cs @@ -294,7 +294,7 @@ public async Task Resolve_Parallel_Both_Services_Offline_SharedEntryField_NonNul "A", """ type Query { - viewer: Viewer! + viewer: Viewer! @shareable } type Viewer { @@ -307,7 +307,7 @@ type Viewer { "B", """ type Query { - viewer: Viewer! + viewer: Viewer! @shareable } type Viewer { @@ -1153,7 +1153,7 @@ type Product { brand: Brand! } - type Brand { + type Brand @key(fields: "id") { id: ID! } """, @@ -1218,7 +1218,7 @@ type Product { brand: Brand! } - type Brand { + type Brand @key(fields: "id") { id: ID! } """, @@ -1283,7 +1283,7 @@ type Product { brand: Brand } - type Brand { + type Brand @key(fields: "id") { id: ID! } """); @@ -1348,7 +1348,7 @@ type Product { brand: Brand } - type Brand { + type Brand @key(fields: "id") { id: ID! } """); @@ -1413,7 +1413,7 @@ type Product { brand: Brand! } - type Brand { + type Brand @key(fields: "id") { id: ID! } """); diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values.yaml index 46d92f80ca8..c2814e01946 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values.yaml @@ -71,8 +71,8 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } type User implements Node { @@ -144,8 +144,8 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable userBySlug(slug: String!): User } @@ -243,8 +243,8 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } type ResaleFeedback implements Node { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values_And_Forwarded_Variable.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values_And_Forwarded_Variable.yaml index 6d210732d30..a242eea82da 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values_And_Forwarded_Variable.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values_And_Forwarded_Variable.yaml @@ -79,8 +79,8 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } type User implements Node { @@ -156,8 +156,8 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable userBySlug(slug: String!): User } @@ -259,8 +259,8 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } type ResaleFeedback implements Node { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values_Some_Items_Null.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values_Some_Items_Null.yaml index 182ff784d0e..26d82fb23c2 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values_Some_Items_Null.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.BatchExecutionState_With_Multiple_Variable_Values_Some_Items_Null.yaml @@ -71,8 +71,8 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } type User implements Node { @@ -144,8 +144,8 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! @null(atIndex: 1) + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @null(atIndex: 1) @shareable userBySlug(slug: String!): User } @@ -243,8 +243,8 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable } type ResaleFeedback implements Node { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node.yaml index 136dbeb16de..18516fc7ca0 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node.yaml @@ -47,7 +47,7 @@ sourceSchemas: type ProductAvailability implements Node { id: ID! - sharedLinked: ProductAvailabilityMail! + sharedLinked: ProductAvailabilityMail! @shareable } type ProductAvailabilityMail { @@ -55,9 +55,9 @@ sourceSchemas: } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable productById(id: ID!): Product @lookup - productAvailabilityById(id: ID!): ProductAvailability @lookup + productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable } interactions: - request: @@ -105,7 +105,7 @@ sourceSchemas: type ProductAvailability implements Node { id: ID! - sharedLinked: ProductAvailabilityMail! + sharedLinked: ProductAvailabilityMail! @shareable } type ProductAvailabilityMail { @@ -113,8 +113,8 @@ sourceSchemas: } type Query { - node("ID of the object." id: ID!): Node @lookup - productAvailabilityById(id: ID!): ProductAvailability @lookup + node("ID of the object." id: ID!): Node @lookup @shareable + productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable } interactions: - request: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node_2.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node_2.yaml index e4bd9a33572..d8f8d8a9552 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node_2.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node_2.yaml @@ -51,17 +51,17 @@ sourceSchemas: type ProductAvailability implements Node { id: ID! - sharedLinked: ProductAvailabilityMail! + sharedLinked: ProductAvailabilityMail! @shareable } type ProductAvailabilityMail { - sharedScalar: String! + sharedScalar: String! @shareable } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable productById(id: ID!): Product @lookup - productAvailabilityById(id: ID!): ProductAvailability @lookup + productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable } interactions: - request: @@ -108,19 +108,19 @@ sourceSchemas: } type ProductAvailability implements Node { - sharedLinked: ProductAvailabilityMail! + sharedLinked: ProductAvailabilityMail! @shareable subgraph2Only: Boolean! id: ID! } type ProductAvailabilityMail { subgraph2Only: Boolean! - sharedScalar: String! + sharedScalar: String! @shareable } type Query { - node(id: ID!): Node @lookup - productAvailabilityById(id: ID!): ProductAvailability @lookup + node(id: ID!): Node @lookup @shareable + productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable } interactions: - request: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node_3.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node_3.yaml index e3fba333ed9..fcd7a83f7d6 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node_3.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Field_Below_Shared_Field_Only_Available_On_One_Subgraph_Type_Of_Shared_Field_Not_Node_3.yaml @@ -55,19 +55,19 @@ sourceSchemas: type ProductAvailability implements Node { id: ID! - sharedLinked: ProductAvailabilityMail! + sharedLinked: ProductAvailabilityMail! @shareable subgraph1Only: Boolean! } type ProductAvailabilityMail { - sharedScalar: String! + sharedScalar: String! @shareable subgraph1Only: String! } type Query { - node(id: ID!): Node @lookup + node(id: ID!): Node @lookup @shareable productById(id: ID!): Product @lookup - productAvailabilityById(id: ID!): ProductAvailability @lookup + productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable } interactions: - request: @@ -118,19 +118,19 @@ sourceSchemas: } type ProductAvailability implements Node { - sharedLinked: ProductAvailabilityMail! + sharedLinked: ProductAvailabilityMail! @shareable subgraph2Only: Boolean! id: ID! } type ProductAvailabilityMail { subgraph2Only: Boolean! - sharedScalar: String! + sharedScalar: String! @shareable } type Query { - node(id: ID!): Node @lookup - productAvailabilityById(id: ID!): ProductAvailability @lookup + node(id: ID!): Node @lookup @shareable + productAvailabilityById(id: ID!): ProductAvailability @lookup @shareable } interactions: - request: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Same_Selection_On_Two_Object_Types_That_Require_Data_From_Another_Subgraph.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Same_Selection_On_Two_Object_Types_That_Require_Data_From_Another_Subgraph.yaml index 3d852ca7f8f..02fe5e271ad 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Same_Selection_On_Two_Object_Types_That_Require_Data_From_Another_Subgraph.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Same_Selection_On_Two_Object_Types_That_Require_Data_From_Another_Subgraph.yaml @@ -40,7 +40,7 @@ sourceSchemas: query: Query } - interface Node { + interface Node @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Subgraph_Containing_More_Selections_Is_Chosen.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Subgraph_Containing_More_Selections_Is_Chosen.yaml index de9ec596f3f..cb388153d4b 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Subgraph_Containing_More_Selections_Is_Chosen.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Subgraph_Containing_More_Selections_Is_Chosen.yaml @@ -28,7 +28,7 @@ sourceSchemas: query: Query } - type Product { + type Product @key(fields: "id") { id: ID! } @@ -60,16 +60,16 @@ sourceSchemas: } type Author { - name: String! + name: String! @shareable } type Product { id: ID! - author: Author + author: Author @shareable } type Query { - productById(id: ID!): Product @lookup + productById(id: ID!): Product @lookup @shareable } - name: C schema: | @@ -78,17 +78,17 @@ sourceSchemas: } type Author { - name: String! + name: String! @shareable rating: Int! } type Product { id: ID! - author: Author + author: Author @shareable } type Query { - productById(id: ID!): Product @lookup + productById(id: ID!): Product @lookup @shareable } interactions: - request: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Unresolvable_Subgraph_Is_Not_Chosen_If_Data_Is_Available_In_Resolvable_Subgraph.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Unresolvable_Subgraph_Is_Not_Chosen_If_Data_Is_Available_In_Resolvable_Subgraph.yaml index 1fac4b0067b..84c298ba752 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Unresolvable_Subgraph_Is_Not_Chosen_If_Data_Is_Available_In_Resolvable_Subgraph.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Unresolvable_Subgraph_Is_Not_Chosen_If_Data_Is_Available_In_Resolvable_Subgraph.yaml @@ -28,7 +28,7 @@ sourceSchemas: query: Query } - interface Node { + interface Node @key(fields: "id") { id: ID! } @@ -71,9 +71,9 @@ sourceSchemas: query: Query } - type Product { + type Product @key(fields: "id") { id: ID! - name: String! + name: String! @shareable } type Query { @@ -95,7 +95,7 @@ sourceSchemas: type Product implements Node { id: ID! - name: String! + name: String! @shareable } type Query { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_1.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_1.yaml index 111b1726593..98f735138b3 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_1.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_1.yaml @@ -34,7 +34,7 @@ sourceSchemas: type Query { exclusiveSubgraphA: ExclusiveSubgraphA - viewer: Viewer + viewer: Viewer @shareable } type Viewer { @@ -65,7 +65,7 @@ sourceSchemas: } type Query { - viewer: Viewer + viewer: Viewer @shareable } type Viewer { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_2.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_2.yaml index 6a0ef189537..ea5a4b8e51f 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_2.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_2.yaml @@ -38,7 +38,7 @@ sourceSchemas: type Query { exclusiveSubgraphA: ExclusiveSubgraphA - viewer: Viewer + viewer: Viewer @shareable } type SubType { @@ -46,7 +46,7 @@ sourceSchemas: } type Viewer { - subType: SubType + subType: SubType @shareable } interactions: - request: @@ -73,7 +73,7 @@ sourceSchemas: } type Query { - viewer: Viewer + viewer: Viewer @shareable } type SubType { @@ -81,7 +81,7 @@ sourceSchemas: } type Viewer { - subType: SubType + subType: SubType @shareable } interactions: - request: diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_3.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_3.yaml index f472b8d2ace..c6429ba8210 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_3.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/DemoIntegrationTests.Viewer_Bug_3.yaml @@ -33,7 +33,7 @@ sourceSchemas: } type Query { - viewer: Viewer! + viewer: Viewer! @shareable } type Viewer { @@ -64,7 +64,7 @@ sourceSchemas: } type Query { - viewer: Viewer! + viewer: Viewer! @shareable } type Viewer { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_NonNull_One_Service_Errors_EntryField.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_NonNull_One_Service_Errors_EntryField.yaml index 7982108d67f..60d3fb6a170 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_NonNull_One_Service_Errors_EntryField.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_NonNull_One_Service_Errors_EntryField.yaml @@ -34,7 +34,7 @@ sourceSchemas: query: Query } - type Brand { + type Brand @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_NonNull_One_Service_Errors_SubField.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_NonNull_One_Service_Errors_SubField.yaml index 80600263ba7..25eac97730e 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_NonNull_One_Service_Errors_SubField.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_NonNull_One_Service_Errors_SubField.yaml @@ -34,7 +34,7 @@ sourceSchemas: query: Query } - type Brand { + type Brand @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_Nullable_One_Service_Errors_EntryField.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_Nullable_One_Service_Errors_EntryField.yaml index a6f8d45ba26..767440f9dce 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_Nullable_One_Service_Errors_EntryField.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_Nullable_One_Service_Errors_EntryField.yaml @@ -37,7 +37,7 @@ sourceSchemas: query: Query } - type Brand { + type Brand @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_Nullable_One_Service_Errors_SubField.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_Nullable_One_Service_Errors_SubField.yaml index d30aca539e9..82f7987e4c1 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_Nullable_One_Service_Errors_SubField.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_NonNull_Parent_Nullable_One_Service_Errors_SubField.yaml @@ -37,7 +37,7 @@ sourceSchemas: query: Query } - type Brand { + type Brand @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_Nullable_Parent_Nullable_One_Service_Errors_EntryField.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_Nullable_Parent_Nullable_One_Service_Errors_EntryField.yaml index 29602cfbe2d..f0a77593a12 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_Nullable_Parent_Nullable_One_Service_Errors_EntryField.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_Nullable_Parent_Nullable_One_Service_Errors_EntryField.yaml @@ -40,7 +40,7 @@ sourceSchemas: query: Query } - type Brand { + type Brand @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_Nullable_Parent_Nullable_One_Service_Errors_SubField.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_Nullable_Parent_Nullable_One_Service_Errors_SubField.yaml index 321244b1d1c..f7a3aa98214 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_Nullable_Parent_Nullable_One_Service_Errors_SubField.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/SubgraphErrorTests.Resolve_Sequence_SubField_Nullable_Parent_Nullable_One_Service_Errors_SubField.yaml @@ -40,7 +40,7 @@ sourceSchemas: query: Query } - type Brand { + type Brand @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Parallel_Both_Services_Offline_SharedEntryField_NonNull.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Parallel_Both_Services_Offline_SharedEntryField_NonNull.yaml index d874f401f78..195da7fd4ca 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Parallel_Both_Services_Offline_SharedEntryField_NonNull.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Parallel_Both_Services_Offline_SharedEntryField_NonNull.yaml @@ -27,7 +27,7 @@ sourceSchemas: } type Query { - viewer: Viewer! + viewer: Viewer! @shareable } type Viewer { @@ -50,7 +50,7 @@ sourceSchemas: } type Query { - viewer: Viewer! + viewer: Viewer! @shareable } type Viewer { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_First_Service_Offline_EntryField_NonNull.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_First_Service_Offline_EntryField_NonNull.yaml index 3910adb65f8..29f36112d32 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_First_Service_Offline_EntryField_NonNull.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_First_Service_Offline_EntryField_NonNull.yaml @@ -29,7 +29,7 @@ sourceSchemas: query: Query } - type Brand { + type Brand @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_First_Service_Offline_EntryField_Nullable.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_First_Service_Offline_EntryField_Nullable.yaml index 24550199968..146b1c87ead 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_First_Service_Offline_EntryField_Nullable.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_First_Service_Offline_EntryField_Nullable.yaml @@ -32,7 +32,7 @@ sourceSchemas: query: Query } - type Brand { + type Brand @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_NonNull_Parent_NonNull.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_NonNull_Parent_NonNull.yaml index f9f7b1e2cad..59e085b28d6 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_NonNull_Parent_NonNull.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_NonNull_Parent_NonNull.yaml @@ -34,7 +34,7 @@ sourceSchemas: query: Query } - type Brand { + type Brand @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_NonNull_Parent_Nullable.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_NonNull_Parent_Nullable.yaml index 1a1e7477fd2..d67fb281c4b 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_NonNull_Parent_Nullable.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_NonNull_Parent_Nullable.yaml @@ -37,7 +37,7 @@ sourceSchemas: query: Query } - type Brand { + type Brand @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_Nullable_Parent_Nullable.yaml b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_Nullable_Parent_Nullable.yaml index fb85484d226..783060ca18c 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_Nullable_Parent_Nullable.yaml +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.AspNetCore.Tests/v15/__snapshots__/TransportErrorTests.Resolve_Sequence_Second_Service_Offline_SubField_Nullable_Parent_Nullable.yaml @@ -40,7 +40,7 @@ sourceSchemas: query: Query } - type Brand { + type Brand @key(fields: "id") { id: ID! } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/CompositionTestHelper.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/CompositionTestHelper.cs index 7ff3446ee65..4e9fa28340e 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/CompositionTestHelper.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/CompositionTestHelper.cs @@ -17,10 +17,19 @@ internal static ImmutableSortedSet CreateSchemaDefiniti log, new SourceSchemaParserOptions { EnableSchemaValidation = false }); - var result = sourceSchemaParser.Parse(); + var (_, isFailure, schemas, _) = sourceSchemaParser.Parse(); - return result.IsFailure - ? throw new Exception($"Schema creation failed.\n- {string.Join("\n- ", log)}") - : result.Value; + if (isFailure) + { + throw new Exception($"Schema creation failed.\n- {string.Join("\n- ", log)}"); + } + + foreach (var schema in schemas) + { + new SourceSchemaPreprocessor(schema).Process(); + new SourceSchemaEnricher(schema, schemas).Enrich(); + } + + return schemas; } } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/PreMergeValidationRules/InvalidFieldSharingRuleTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/PreMergeValidationRules/InvalidFieldSharingRuleTests.cs new file mode 100644 index 00000000000..daf442d23ee --- /dev/null +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/PreMergeValidationRules/InvalidFieldSharingRuleTests.cs @@ -0,0 +1,127 @@ +namespace HotChocolate.Fusion.PreMergeValidationRules; + +public sealed class InvalidFieldSharingRuleTests : RuleTestBase +{ + protected override object Rule { get; } = new InvalidFieldSharingRule(); + + // In this example, the "User" type field "fullName" is marked as shareable in both schemas, + // allowing them to serve consistent data for that field without conflict. + [Fact] + public void Validate_ValidFieldSharing_Succeeds() + { + AssertValid( + [ + """ + # Schema A + type User @key(fields: "id") { + id: ID! + username: String + fullName: String @shareable + } + """, + """ + # Schema B + type User @key(fields: "id") { + id: ID! + fullName: String @shareable + email: String + } + """ + ]); + } + + // In the following example, "User.fullName" is overridden in one schema and therefore the field + // can be defined in the other schema without being marked as @shareable. + [Fact] + public void Validate_ValidFieldSharingOneDefinitionOverridden_Succeeds() + { + AssertValid( + [ + """ + # Schema A + type User @key(fields: "id") { + id: ID! + fullName: String @override(from: "B") + } + """, + """ + # Schema B + type User @key(fields: "id") { + id: ID! + fullName: String + } + """ + ]); + } + + // In the following example, "User.fullName" is marked as @external in one schema and therefore + // the field can be defined in the other schema without being marked as @shareable. + [Fact] public void Validate_ValidFieldSharingOneDefinitionExternal_Succeeds() + { + AssertValid( + [ + """ + # Schema A + type User @key(fields: "id") { + id: ID! + fullName: String @external + } + """, + """ + # Schema B + type User @key(fields: "id") { + id: ID! + fullName: String + } + """ + ]); + } + + // In the following example, "User.fullName" is non-shareable but is defined and resolved by two + // different schemas, resulting in an INVALID_FIELD_SHARING error. + [Fact] + public void Validate_InvalidFieldSharing_Fails() + { + AssertInvalid( + [ + """ + # Schema A + type User @key(fields: "id") { + id: ID! + fullName: String + } + """, + """ + # Schema B + type User @key(fields: "id") { + id: ID! + fullName: String + } + """ + ], + [ + """ + { + "message": "The field 'User.fullName' in schema 'A' must be shareable.", + "code": "INVALID_FIELD_SHARING", + "severity": "Error", + "coordinate": "User.fullName", + "member": "fullName", + "schema": "A", + "extensions": {} + } + """, + """ + { + "message": "The field 'User.fullName' in schema 'B' must be shareable.", + "code": "INVALID_FIELD_SHARING", + "severity": "Error", + "coordinate": "User.fullName", + "member": "fullName", + "schema": "B", + "extensions": {} + } + """ + ]); + } +} diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaEnricherTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaEnricherTests.cs index a13fa5ac0a2..bc9b667c655 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaEnricherTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaEnricherTests.cs @@ -1,5 +1,7 @@ using HotChocolate.Fusion.Extensions; +using HotChocolate.Fusion.Features; using HotChocolate.Fusion.Logging; +using HotChocolate.Types; using HotChocolate.Types.Mutable; namespace HotChocolate.Fusion; @@ -38,42 +40,45 @@ type BookCategory implements Category @shareable { """); var sourceSchemaParser = new SourceSchemaParser([sourceSchemaText], new CompositionLog()); var schema = sourceSchemaParser.Parse().Value.Single(); - var enricher = new SourceSchemaEnricher(schema); + var enricher = new SourceSchemaEnricher(schema, [schema]); // act enricher.Enrich(); + static SourceFieldMetadata GetMetadata(IOutputFieldDefinition field) => + field.GetRequiredSourceFieldMetadata(); + var productType = (MutableObjectTypeDefinition)schema.Types["Product"]; - var productIdFieldMetadata = productType.Fields["id"].GetSourceFieldMetadata(); - var productCategoryFieldMetadata = productType.Fields["category"].GetSourceFieldMetadata(); - var productSkuFieldMetadata = productType.Fields["sku"].GetSourceFieldMetadata(); - var productAlreadyShareableFieldMetadata = productType.Fields["alreadyShareable"].GetSourceFieldMetadata(); - var productExternalFieldMetadata = productType.Fields["externalField"].GetSourceFieldMetadata(); - var productNonKeyFieldMetadata = productType.Fields["nonKeyField"].GetSourceFieldMetadata(); + var productIdFieldMetadata = GetMetadata(productType.Fields["id"]); + var productCategoryFieldMetadata = GetMetadata(productType.Fields["category"]); + var productSkuFieldMetadata = GetMetadata(productType.Fields["sku"]); + var productAlreadyShareableFieldMetadata = GetMetadata(productType.Fields["alreadyShareable"]); + var productExternalFieldMetadata = GetMetadata(productType.Fields["externalField"]); + var productNonKeyFieldMetadata = GetMetadata(productType.Fields["nonKeyField"]); var categoryType = (MutableInterfaceTypeDefinition)schema.Types["Category"]; - var categoryIdFieldMetadata = categoryType.Fields["id"].GetSourceFieldMetadata(); + var categoryIdFieldMetadata = GetMetadata(categoryType.Fields["id"]); var bookCategoryType = (MutableObjectTypeDefinition)schema.Types["BookCategory"]; - var bookCategoryIdFieldMetadata = bookCategoryType.Fields["id"].GetSourceFieldMetadata(); - var bookCategoryCountFieldMetadata = bookCategoryType.Fields["count"].GetSourceFieldMetadata(); + var bookCategoryIdFieldMetadata = GetMetadata(bookCategoryType.Fields["id"]); + var bookCategoryCountFieldMetadata = GetMetadata(bookCategoryType.Fields["count"]); // assert - Assert.True(productIdFieldMetadata?.IsKeyField); - Assert.True(productIdFieldMetadata?.IsShareable); - Assert.True(productCategoryFieldMetadata?.IsKeyField); - Assert.True(productCategoryFieldMetadata?.IsShareable); - Assert.True(productSkuFieldMetadata?.IsKeyField); - Assert.True(productSkuFieldMetadata?.IsShareable); - Assert.True(productAlreadyShareableFieldMetadata?.IsKeyField); - Assert.True(productAlreadyShareableFieldMetadata?.IsShareable); - Assert.True(productExternalFieldMetadata?.IsKeyField); - Assert.False(productExternalFieldMetadata?.IsShareable); - Assert.False(productNonKeyFieldMetadata?.IsKeyField); - Assert.False(productNonKeyFieldMetadata?.IsShareable); - Assert.True(categoryIdFieldMetadata?.IsKeyField); - Assert.True(categoryIdFieldMetadata?.IsShareable); - Assert.False(bookCategoryIdFieldMetadata?.IsKeyField); - Assert.True(bookCategoryIdFieldMetadata?.IsShareable); - Assert.False(bookCategoryCountFieldMetadata?.IsKeyField); - Assert.True(bookCategoryCountFieldMetadata?.IsShareable); + Assert.True(productIdFieldMetadata.IsKeyField); + Assert.True(productIdFieldMetadata.IsShareable); + Assert.True(productCategoryFieldMetadata.IsKeyField); + Assert.True(productCategoryFieldMetadata.IsShareable); + Assert.True(productSkuFieldMetadata.IsKeyField); + Assert.True(productSkuFieldMetadata.IsShareable); + Assert.True(productAlreadyShareableFieldMetadata.IsKeyField); + Assert.True(productAlreadyShareableFieldMetadata.IsShareable); + Assert.True(productExternalFieldMetadata.IsKeyField); + Assert.False(productExternalFieldMetadata.IsShareable); + Assert.False(productNonKeyFieldMetadata.IsKeyField); + Assert.False(productNonKeyFieldMetadata.IsShareable); + Assert.True(categoryIdFieldMetadata.IsKeyField); + Assert.True(categoryIdFieldMetadata.IsShareable); + Assert.False(bookCategoryIdFieldMetadata.IsKeyField); + Assert.True(bookCategoryIdFieldMetadata.IsShareable); + Assert.False(bookCategoryCountFieldMetadata.IsKeyField); + Assert.True(bookCategoryCountFieldMetadata.IsShareable); } } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaMergerTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaMergerTests.cs index 0a85e1bc21f..c2f3fd9d06f 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaMergerTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaMergerTests.cs @@ -14,21 +14,20 @@ public void Merge_WithOperationTypes_SetsOperationTypes() { // arrange var intType = BuiltIns.Int.Create(); - var merger = new SourceSchemaMerger( - [ - new MutableSchemaDefinition + var schema = new MutableSchemaDefinition + { + Types = { - Types = - { - new MutableObjectTypeDefinition(Query) - { Fields = { new MutableOutputFieldDefinition("field", intType) } }, - new MutableObjectTypeDefinition(Mutation) - { Fields = { new MutableOutputFieldDefinition("field", intType) } }, - new MutableObjectTypeDefinition(Subscription) - { Fields = { new MutableOutputFieldDefinition("field", intType) } } - } + new MutableObjectTypeDefinition(Query) + { Fields = { new MutableOutputFieldDefinition("field", intType) } }, + new MutableObjectTypeDefinition(Mutation) + { Fields = { new MutableOutputFieldDefinition("field", intType) } }, + new MutableObjectTypeDefinition(Subscription) + { Fields = { new MutableOutputFieldDefinition("field", intType) } } } - ]); + }; + new SourceSchemaEnricher(schema, [schema]).Enrich(); + var merger = new SourceSchemaMerger([schema]); // act var (isSuccess, _, mergedSchema, _) = merger.Merge(); @@ -44,24 +43,23 @@ public void Merge_WithOperationTypes_SetsOperationTypes() public void Merge_WithEmptyMutationAndSubscriptionType_RemovesEmptyOperationTypes() { // arrange - var merger = new SourceSchemaMerger( - [ - new MutableSchemaDefinition + var schema = new MutableSchemaDefinition + { + Types = { - Types = + new MutableObjectTypeDefinition(Query) { - new MutableObjectTypeDefinition(Query) + Fields = { - Fields = - { - new MutableOutputFieldDefinition("field", BuiltIns.Int.Create()) - } - }, - new MutableObjectTypeDefinition(Mutation), - new MutableObjectTypeDefinition(Subscription) - } + new MutableOutputFieldDefinition("field", BuiltIns.Int.Create()) + } + }, + new MutableObjectTypeDefinition(Mutation), + new MutableObjectTypeDefinition(Subscription) } - ]); + }; + new SourceSchemaEnricher(schema, [schema]).Enrich(); + var merger = new SourceSchemaMerger([schema]); // act var (isSuccess, _, mergedSchema, _) = merger.Merge(); @@ -131,7 +129,10 @@ input ProductDimensionInput @inaccessible { } """); var sourceSchemaParser = new SourceSchemaParser([sourceSchemaTextA, sourceSchemaTextB], new CompositionLog()); - var merger = new SourceSchemaMerger(sourceSchemaParser.Parse().Value); + var schemas = sourceSchemaParser.Parse().Value; + new SourceSchemaEnricher(schemas[0], schemas).Enrich(); + new SourceSchemaEnricher(schemas[1], schemas).Enrich(); + var merger = new SourceSchemaMerger(schemas); // act var result = merger.Merge(); diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaPreprocessorTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaPreprocessorTests.cs index 6cc95757388..c62c1692760 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaPreprocessorTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaPreprocessorTests.cs @@ -102,4 +102,115 @@ type Person { // assert Assert.False(schema.Types["Person"].Directives.ContainsName(WellKnownDirectiveNames.Key)); } + + [Fact] + public void Preprocess_InheritInterfaceKeysEnabled_InheritsInterfaceKeys() + { + // arrange + var sourceSchemaText = + new SourceSchemaText( + "A", + """ + interface Animal @key(fields: "id") @key(fields: "age") { + id: ID! + age: Int + } + + interface Pet implements Animal @key(fields: "name") { + id: ID! + age: Int + name: String + } + + type Dog implements Pet & Animal { + id: ID! + age: Int + name: String + } + + type Cat implements Pet & Animal { + id: ID! + age: Int + name: String + } + """); + var sourceSchemaParser = new SourceSchemaParser([sourceSchemaText], new CompositionLog()); + var schema = sourceSchemaParser.Parse().Value.Single(); + var preprocessor = new SourceSchemaPreprocessor(schema); + + // act + preprocessor.Process(); + schema.Types.Remove("FieldSelectionMap"); + schema.Types.Remove("FieldSelectionSet"); + schema.DirectiveDefinitions.Clear(); + + // assert + schema.ToString().MatchInlineSnapshot( + // lang=graphql + """ + type Cat implements Pet & Animal + @key(fields: "name") + @key(fields: "id") + @key(fields: "age") { + age: Int + id: ID! + name: String + } + + type Dog implements Pet & Animal + @key(fields: "name") + @key(fields: "id") + @key(fields: "age") { + age: Int + id: ID! + name: String + } + + interface Animal + @key(fields: "id") + @key(fields: "age") { + age: Int + id: ID! + } + + interface Pet implements Animal + @key(fields: "name") + @key(fields: "id") + @key(fields: "age") { + age: Int + id: ID! + name: String + } + """); + } + + [Fact] + public void Preprocess_InheritInterfaceKeysDisabled_DoesNotInheritInterfaceKeys() + { + // arrange + var sourceSchemaText = + new SourceSchemaText( + "A", + """ + interface Pet @key(fields: "id") { + id: ID! + } + + type Cat implements Pet { + id: ID! + } + """); + var sourceSchemaParser = new SourceSchemaParser([sourceSchemaText], new CompositionLog()); + var schema = sourceSchemaParser.Parse().Value.Single(); + var preprocessor = + new SourceSchemaPreprocessor( + schema, + new SourceSchemaPreprocessorOptions { InheritInterfaceKeys = false }); + + // act + preprocessor.Process(); + + // assert + Assert.False(schema.Types["Cat"].Directives.ContainsName(WellKnownDirectiveNames.Key)); + } } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaValidationRules/InvalidShareableUsageRuleTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaValidationRules/InvalidShareableUsageRuleTests.cs index e618d552e14..fe8b67e25cc 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaValidationRules/InvalidShareableUsageRuleTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaValidationRules/InvalidShareableUsageRuleTests.cs @@ -26,7 +26,7 @@ type Order { // which is invalid usage. Marking an interface field as shareable leads to an // INVALID_SHAREABLE_USAGE error. [Fact] - public void Validate_InvalidShareableUsage_Fails() + public void Validate_InvalidShareableUsageInterfaceField_Fails() { AssertInvalid( [ @@ -40,7 +40,7 @@ interface InventoryItem { [ """ { - "message": "The interface field 'InventoryItem.sku' in schema 'A' must not be marked as shareable.", + "message": "The field 'InventoryItem.sku' in schema 'A' must not be marked as shareable.", "code": "INVALID_SHAREABLE_USAGE", "severity": "Error", "coordinate": "InventoryItem.sku", @@ -51,4 +51,55 @@ interface InventoryItem { """ ]); } + + // By definition, root subscription fields cannot be shared across multiple schemas. In this + // example, both schemas define a subscription field "newOrderPlaced". + [Fact] + public void Validate_InvalidShareableUsageSubscriptionField_Fails() + { + AssertInvalid( + [ + """ + # Schema A + type Subscription { + newOrderPlaced: Order @shareable + } + + type Order { + id: ID! + items: [String] + } + """, + """ + # Schema B + type Subscription { + newOrderPlaced: Order @shareable + } + """ + ], + [ + """ + { + "message": "The field 'Subscription.newOrderPlaced' in schema 'A' must not be marked as shareable.", + "code": "INVALID_SHAREABLE_USAGE", + "severity": "Error", + "coordinate": "Subscription.newOrderPlaced", + "member": "newOrderPlaced", + "schema": "A", + "extensions": {} + } + """, + """ + { + "message": "The field 'Subscription.newOrderPlaced' in schema 'B' must not be marked as shareable.", + "code": "INVALID_SHAREABLE_USAGE", + "severity": "Error", + "coordinate": "Subscription.newOrderPlaced", + "member": "newOrderPlaced", + "schema": "B", + "extensions": {} + } + """ + ]); + } } diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/FusionTestBase.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/FusionTestBase.cs index 9e869e36d86..370dc37a0d0 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/FusionTestBase.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/FusionTestBase.cs @@ -57,7 +57,7 @@ interface Node { id: ID! } - type PageInfo { + type PageInfo @shareable { hasNextPage: Boolean! hasPreviousPage: Boolean! startCursor: String @@ -65,8 +65,8 @@ type PageInfo { } type Query { - node("ID of the object." id: ID!): Node @lookup - nodes("The list of node IDs." ids: [ID!]!): [Node]! + node("ID of the object." id: ID!): Node @lookup @shareable + nodes("The list of node IDs." ids: [ID!]!): [Node]! @shareable userById(id: ID!): User @lookup userByUsername(username: String!): User @lookup users(first: Int after: String last: Int before: String): UsersConnection @@ -74,7 +74,7 @@ type Query { type User implements Node { id: ID! - name: String! + name: String! @shareable birthdate: String! username: String! } @@ -112,8 +112,8 @@ type Product { } type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable inventoryItemById(id: ID!): InventoryItem @lookup productByIdAsync(id: ID!): Product @lookup @internal } @@ -156,14 +156,14 @@ type OrderItem { order: Order } - type Product { + type Product @key(fields: "id") { id: ID! } type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! - orderById(id: ID!): Order @lookup + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable + orderById(id: ID!): Order @lookup @shareable userById(id: ID!): User! @lookup @internal } @@ -211,10 +211,10 @@ type Payment implements Node { } type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable paymentById(id: ID!): Payment @lookup - orderById(id: ID!): Order! @lookup + orderById(id: ID!): Order! @lookup @shareable } input CreatePaymentInput { @@ -241,7 +241,7 @@ type Mutation { uploadProductPicture(input: UploadProductPictureInput!): UploadProductPicturePayload! } - type PageInfo { + type PageInfo @shareable { hasNextPage: Boolean! hasPreviousPage: Boolean! startCursor: String @@ -276,8 +276,8 @@ type ProductsEdge { } type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable productById(id: ID!): Product @lookup products(first: Int after: String last: Int before: String): ProductsConnection } @@ -312,7 +312,7 @@ type Mutation { createReview(input: CreateReviewInput!): CreateReviewPayload! } - type PageInfo { + type PageInfo @shareable { hasNextPage: Boolean! hasPreviousPage: Boolean! startCursor: String @@ -336,8 +336,8 @@ type ProductReviewsEdge { } type Query { - node(id: ID!): Node @lookup - nodes(ids: [ID!]!): [Node]! + node(id: ID!): Node @lookup @shareable + nodes(ids: [ID!]!): [Node]! @shareable productById(id: ID!): Product! @lookup @internal reviewById(id: ID!): Review @lookup userById(id: ID!): User @lookup @internal @@ -359,7 +359,7 @@ type Subscription { type User { reviews(first: Int after: String last: Int before: String): UserReviewsConnection id: ID! - name: String! + name: String! @shareable } type UserReviewsConnection { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/Planning/OperationPlannerTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/Planning/OperationPlannerTests.cs index d52da6b6069..e430a0587ff 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/Planning/OperationPlannerTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/Planning/OperationPlannerTests.cs @@ -111,7 +111,7 @@ type Query { topProducts: [Product!] } - type Product { + type Product @key(fields: "id") { id: ID! name: String! } @@ -273,7 +273,7 @@ type Query { topProducts: [Product!] } - type Product { + type Product @key(fields: "id") { id: ID! name: String! region: String! @@ -325,7 +325,7 @@ type Query { topProducts: [Product!] } - type Product { + type Product @key(fields: "id") { id: ID! name: String! region: String! @@ -377,7 +377,7 @@ type Query { topProducts: [Product!] } - type Product { + type Product @key(fields: "id") { id: ID! region: String! } @@ -393,7 +393,7 @@ type Query { type Product { id: ID! - sku(region: String! @require(field: "region")): String! + sku(region: String! @require(field: "region")): String! @shareable } """, """ diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/Planning/RequirementTests.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/Planning/RequirementTests.cs index 9efcbf6f267..79e5eb5a8e0 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/Planning/RequirementTests.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/Planning/RequirementTests.cs @@ -16,7 +16,7 @@ type Query { books: [Book] } - type Book { + type Book @key(fields: "id") { id: String! title: String! } @@ -66,7 +66,7 @@ type Brand { name: String! } - type Product { + type Product @key(fields: "id") { id: Int! name: String! brand: Brand @@ -122,7 +122,7 @@ type Brand { name: String! } - type Product { + type Product @key(fields: "id") { id: Int! name: String! brand: Brand diff --git a/src/Nitro/CommandLine/test/CommandLine.Fusion.Tests/__resources__/invalid-example-1/source-schema-1.graphqls b/src/Nitro/CommandLine/test/CommandLine.Fusion.Tests/__resources__/invalid-example-1/source-schema-1.graphqls index 74a96d2f46d..de50d8e9b68 100644 --- a/src/Nitro/CommandLine/test/CommandLine.Fusion.Tests/__resources__/invalid-example-1/source-schema-1.graphqls +++ b/src/Nitro/CommandLine/test/CommandLine.Fusion.Tests/__resources__/invalid-example-1/source-schema-1.graphqls @@ -3,7 +3,7 @@ schema { } type Query { - userById(id: ID!): User! @lookup # Warning: LOOKUP_RETURNS_NON_NULLABLE_TYPE + userById(id: ID!): User! @lookup @shareable # Warning: LOOKUP_RETURNS_NON_NULLABLE_TYPE } type User { diff --git a/src/Nitro/CommandLine/test/CommandLine.Fusion.Tests/__resources__/invalid-example-1/source-schema-2.graphqls b/src/Nitro/CommandLine/test/CommandLine.Fusion.Tests/__resources__/invalid-example-1/source-schema-2.graphqls index 967e906ad5b..9e54af98c0a 100644 --- a/src/Nitro/CommandLine/test/CommandLine.Fusion.Tests/__resources__/invalid-example-1/source-schema-2.graphqls +++ b/src/Nitro/CommandLine/test/CommandLine.Fusion.Tests/__resources__/invalid-example-1/source-schema-2.graphqls @@ -3,7 +3,7 @@ schema { } type Query { - userById(id: ID!): User! @lookup # Warning: LOOKUP_RETURNS_NON_NULLABLE_TYPE + userById(id: ID!): User! @lookup @shareable # Warning: LOOKUP_RETURNS_NON_NULLABLE_TYPE } type User {