Initial Commit ...
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using GraphQL;
|
||||
using GraphQL.Types;
|
||||
using xDataService.Constants;
|
||||
using xModels.Dtos;
|
||||
|
||||
namespace xDataService.Extensions {
|
||||
public static class XGraphQLExtensions {
|
||||
public static TKey GetIdArgument<TKey> (this IResolveFieldContext<object> source) {
|
||||
return source.GetArgument<TKey> (XGraphQLHelper.GetIdArgument<IntGraphType>().Name);
|
||||
}
|
||||
|
||||
public static bool GetIgnoreSoftDeletedArgument<T> (this IResolveFieldContext<T> source) {
|
||||
return source.GetArgument<bool> (XGraphQLHelper.IgnoreSoftDeletedArgument.Name);
|
||||
}
|
||||
|
||||
public static bool GetContainsDetailArgument<T> (this IResolveFieldContext<T> source) {
|
||||
return source.GetArgument<bool> (XGraphQLHelper.ContainsDetailArgument.Name);
|
||||
}
|
||||
|
||||
public static string GetSearchQueryArgument<T> (this IResolveFieldContext<T> source) {
|
||||
return source.GetArgument<string> (XGraphQLHelper.SearchQueryArgument.Name);
|
||||
}
|
||||
|
||||
public static XQuery GetQueryArgument<T> (this IResolveFieldContext<T> source) {
|
||||
return source.GetArgument<XQuery> (XGraphQLHelper.QueryArgument.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user