public FieldType GetFieldType(Boolean isInput) { if (_fieldType != null) { return(_fieldType); } var name = typeof(TQuery).Name; name = !name.EndsWith("Query") ? name : name.Substring(0, name.Length - "Query".Length); _fieldType = new FieldType { ResolvedType = QueryParametersHelper.GetQueryItemType(this, typeof(TResult), false), Name = name, Description = typeof(TQuery).GetCustomAttribute <DescriptionAttribute>()?.Description, Arguments = QueryParametersHelper.GetArguments(typeof(TQuery), this, true), Resolver = new FuncFieldResolver <TResult>(context => ExecuteQuery(context).GetAwaiter().GetResult()), }; return(_fieldType); }
public IGraphType GetQueryItemType(Type modelType, Boolean isInput) { return(QueryParametersHelper.GetQueryItemType(this, modelType, isInput)); }