Beispiel #1
0
        private void AddOutputObjectKnownType(GraphQLNullableType type)
        {
            var reflectedType = type.GetType();
            var argument      = ReflectionUtilities.GetGenericArgumentsEagerly(reflectedType);

            if (argument == null)
            {
                this.outputBindings.Add(reflectedType.FullName, type);
            }
            else
            {
                this.outputBindings.Add(argument.FullName, type);
            }
        }
Beispiel #2
0
        public GraphQLComplexType[] GetTypesImplementing(GraphQLNullableType objectType)
        {
            if (objectType is GraphQLInterfaceType)
            {
                var type = ReflectionUtilities.GetGenericArgumentsEagerly(objectType.GetType());
                return(this.GetOutputKnownTypes()
                       .Where(e => ReflectionUtilities.GetAllImplementingInterfaces(
                                  ReflectionUtilities.GetGenericArgumentsEagerly(e.GetType())).Contains(type))
                       .Select(e => e as GraphQLComplexType)
                       .ToArray());
            }

            return(new GraphQLComplexType[] { });
        }
Beispiel #3
0
 public void AddKnownType(GraphQLNullableType type)
 {
     if (type is GraphQLInputObjectType)
     {
         this.AddInputObjectKnownType(type);
     }
     else if (type is GraphQLComplexType)
     {
         this.AddOutputObjectKnownType(type);
     }
     else
     {
         this.AddInputObjectKnownType(type);
         this.AddOutputObjectKnownType(type);
     }
 }
Beispiel #4
0
 public IObjectTypeTranslator GetObjectTypeTranslatorFor(GraphQLNullableType type)
 {
     return(new ObjectTypeTranslator(type, this, this.schemaObserver));
 }
Beispiel #5
0
 private void RegisterBinding <T>(GraphQLNullableType type)
 {
     this.bindings.Add(typeof(T), type);
 }
Beispiel #6
0
 public GraphQLNonNullType(GraphQLNullableType nullableType) : base(null, null)
 {
     this.UnderlyingNullableType = nullableType;
 }