Esempio n. 1
0
 private IEnumerable <object> CreateList(IEnumerable inputObject, GraphQLList typeDefinition)
 {
     foreach (var item in inputObject)
     {
         yield return(this.TranslatePerDefinition(item, typeDefinition.MemberType));
     }
 }
Esempio n. 2
0
        public GraphQLList CreateInputList(Type arrayType)
        {
            var memberType = ReflectionUtilities.GetCollectionMemberType(arrayType);
            var schemaType = this.GetSchemaInputTypeFor(memberType);
            var list       = new GraphQLList(schemaType);

            return(list);
        }
Esempio n. 3
0
        private IEnumerable CreateSingleValueList(object inputObject, GraphQLList typeDefinition)
        {
            var systemType = this.schemaRepository.GetInputSystemTypeFor(typeDefinition.MemberType);

            var singleValue = this.TranslatePerDefinition(inputObject, typeDefinition.MemberType);

            singleValue = ReflectionUtilities.ChangeValueType(singleValue, systemType);

            yield return(singleValue);
        }
Esempio n. 4
0
        internal static IntrospectedType CreateForList(GraphQLList type, IntrospectedType listItemType)
        {
            var introspectedType = new IntrospectedType();

            introspectedType.Name        = type.Name;
            introspectedType.Description = type.Description;
            introspectedType.Kind        = TypeKind.LIST;
            introspectedType.OfType      = listItemType;

            return(introspectedType);
        }
Esempio n. 5
0
 private IntrospectedType IntrospectListType(GraphQLList type, Func <IntrospectedType> innerType)
 {
     return(IntrospectedType.CreateForList(type, innerType()));
 }