internal Schema(SchemaDefinition definition) { if (definition == null) { throw new ArgumentNullException(nameof(definition)); } Description = definition.Description; Directives = definition.Directives; Services = definition.Services; Options = definition.Options; DirectiveTypes = definition.DirectiveTypes; _types = new SchemaTypes(definition); _directiveTypes = DirectiveTypes.ToDictionary(t => t.Name); }
internal void CompleteSchema( SchemaTypesDefinition schemaTypesDefinition) { if (schemaTypesDefinition == null) { throw new ArgumentNullException(nameof(schemaTypesDefinition)); } if (_sealed) { throw new InvalidOperationException( "This schema is already sealed and cannot be mutated."); } DirectiveTypes = schemaTypesDefinition.DirectiveTypes; _types = new SchemaTypes(schemaTypesDefinition); _directiveTypes = DirectiveTypes.ToDictionary(t => t.Name); _sealed = true; }