private void CompleteIsOfType(ICompletionContext context) { if (_isOfType == null) { if (context.IsOfType != null) { IsOfTypeFallback isOfType = context.IsOfType; _isOfType = (ctx, obj) => isOfType(this, ctx, obj); } else if (ClrType == typeof(object)) { _isOfType = IsOfTypeWithName; } else { _isOfType = IsOfTypeWithClrType; } } }
public TypeInitializer( IServiceProvider services, IDescriptorContext descriptorContext, IDictionary <string, object> contextData, IEnumerable <ITypeReference> initialTypes, IEnumerable <Type> externalResolverTypes, ITypeInitializationInterceptor interceptor, IsOfTypeFallback isOfType, Func <TypeSystemObjectBase, bool> isQueryType) { _services = services; _descriptorContext = descriptorContext; _contextData = contextData; _initialTypes = initialTypes.ToList(); _externalResolverTypes = externalResolverTypes.ToList(); _interceptor = interceptor; _isOfType = isOfType; _isQueryType = isQueryType; }
public CompletionContext( InitializationContext initializationContext, TypeInitializer typeInitializer, IsOfTypeFallback isOfType, Func <ISchema> schemaResolver) { _initializationContext = initializationContext ?? throw new ArgumentNullException( nameof(initializationContext)); _typeInitializer = typeInitializer ?? throw new ArgumentNullException( nameof(typeInitializer)); IsOfType = isOfType; _schemaResolver = schemaResolver ?? throw new ArgumentNullException( nameof(schemaResolver)); GlobalComponents = new ReadOnlyCollection <FieldMiddleware>( _typeInitializer.GlobalComponents); }
public TypeCompletionContext( TypeDiscoveryContext initializationContext, TypeReferenceResolver typeReferenceResolver, IList <FieldMiddleware> globalComponents, IDictionary <FieldReference, RegisteredResolver> resolvers, IsOfTypeFallback isOfType, Func <ISchema> schemaResolver) { _initializationContext = initializationContext ?? throw new ArgumentNullException(nameof(initializationContext)); _typeReferenceResolver = typeReferenceResolver ?? throw new ArgumentNullException(nameof(typeReferenceResolver)); _resolvers = resolvers ?? throw new ArgumentNullException(nameof(resolvers)); IsOfType = isOfType; _schemaResolver = schemaResolver ?? throw new ArgumentNullException(nameof(schemaResolver)); GlobalComponents = new ReadOnlyCollection <FieldMiddleware>(globalComponents); _alternateNames.Add(_initializationContext.InternalName); }
public ISchemaBuilder SetTypeResolver(IsOfTypeFallback isOfType) { _isOfType = isOfType; return(this); }
public void RegisterIsOfType(IsOfTypeFallback isOfType) { _builder.SetTypeResolver(isOfType); }
public ISchemaConfiguration RegisterIsOfType(IsOfTypeFallback isOfType) { _builder.SetTypeResolver(isOfType); return(this); }
public void RegisterIsOfType(IsOfTypeFallback isOfType) { _typeRegistry.IsOfType = isOfType; }