protected override IGraphType GetGraphType(GraphTypeCache cache, IServiceCollection services) { if (_scalarTypeMap.TryGetGraphType(typeof(TElem), out var scalarGraphType)) { var listType = typeof(ListGraphType <>).MakeGenericType(scalarGraphType); return((IGraphType)Activator.CreateInstance(listType)); } return(new ListGraphType(cache.GetOrCreate <TElem>(services))); }
protected override IGraphType GetGraphType(GraphTypeCache cache, IServiceCollection services) { if (_scalarTypeMap.TryGetGraphType(typeof(TProp), out var scalarGraphType)) { var listGraphType = typeof(ListGraphType <>).MakeGenericType(scalarGraphType); var listTypeInstance = (ListGraphType)Activator.CreateInstance(listGraphType); listTypeInstance.ResolvedType = (IGraphType)Activator.CreateInstance(scalarGraphType); if (listTypeInstance.ResolvedType is NonNullGraphType elemTypeInstance) { elemTypeInstance.ResolvedType = (IGraphType)Activator.CreateInstance(scalarGraphType.GetGenericArguments().Single()); } return(listTypeInstance); } return(new ListGraphType(cache.GetOrCreate(typeof(TProp), services))); }
protected override IGraphType GetGraphType(GraphTypeCache cache, IServiceCollection services) { return(cache.GetOrCreate <TProp>(services)); }
protected override IGraphType GetGraphType(GraphTypeCache cache, IServiceCollection services) { return(new ListGraphType(cache.GetOrCreate <TElem>(services))); }
protected override IGraphType GetGraphType(GraphTypeCache cache, IServiceCollection services) { return(cache.GetOrCreate <Connection <TModel> >(services)); }