示例#1
0
 // https://graphql.github.io/graphql-spec/June2018/#sec-Input-and-Output-Types
 /// <summary>
 /// Indicates if the graph type is an input graph type (scalar or input object).
 /// </summary>
 public static bool IsInputType(this IGraphType type)
 {
     var(namedType, namedType2) = type.GetNamedTypes();
     return(namedType is ScalarGraphType ||
            namedType is IInputObjectGraphType ||
            typeof(ScalarGraphType).IsAssignableFrom(namedType2) ||
            typeof(IInputObjectGraphType).IsAssignableFrom(namedType2));
 }
示例#2
0
        // https://graphql.github.io/graphql-spec/June2018/#sec-Input-and-Output-Types
        /// <summary>
        /// Indicates if the graph type is an output graph type (scalar, object, interface or union).
        /// </summary>
        public static bool IsOutputType(this IGraphType type)
        {
            var(namedType, namedType2) = type.GetNamedTypes();
            return(namedType is ScalarGraphType ||
                   namedType is IObjectGraphType ||
                   namedType is IInterfaceGraphType ||
                   namedType is UnionGraphType ||
                   typeof(ScalarGraphType).IsAssignableFrom(namedType2) ||
                   typeof(IObjectGraphType).IsAssignableFrom(namedType2) ||
                   typeof(IInterfaceGraphType).IsAssignableFrom(namedType2) ||
                   typeof(UnionGraphType).IsAssignableFrom(namedType2));

            ;
        }
示例#3
0
 /// <summary>
 /// Indicates if the graph type is a scalar graph type.
 /// </summary>
 public static bool IsLeafType(this IGraphType type)
 {
     var(namedType, namedType2) = type.GetNamedTypes();
     return(namedType is ScalarGraphType ||
            typeof(ScalarGraphType).IsAssignableFrom(namedType2));
 }
示例#4
0
 internal static bool IsGraphQLTypeReference(this IGraphType type)
 {
     var(namedType, _) = type.GetNamedTypes();
     return(namedType is GraphQLTypeReference);
 }