Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
3 contributors

Users who have contributed to this file

@joemcbride @KoditkarVedant @jquense
42 lines (34 sloc) 971 Bytes
using System;
namespace GraphQL.Types
{
public class ListGraphType<T> : ListGraphType
where T : IGraphType
{
public ListGraphType()
: base(typeof(T))
{
}
}
public class ListGraphType : GraphType
{
public ListGraphType(IGraphType type)
{
ResolvedType = type;
}
protected ListGraphType(Type type)
{
Type = type;
}
public Type Type { get; private set; }
public IGraphType ResolvedType { get; set; }
public override string CollectTypes(TypeCollectionContext context)
{
var innerType = context.ResolveType(Type);
ResolvedType = innerType;
var name = innerType.CollectTypes(context);
context.AddType(name, innerType, context);
return "[{0}]".ToFormat(name);
}
public override string ToString() => $"[{ResolvedType}]";
}
}
You can’t perform that action at this time.