public static SchemaBuilder Add(this SchemaBuilder builder, __Type type) { return(type.Kind switch { __TypeKind.SCALAR => builder.AddScalarDefinition(type), __TypeKind.OBJECT => builder.AddObjectDefinition(type), __TypeKind.INTERFACE => builder.AddInterfaceDefinition(type), __TypeKind.UNION => builder.AddUnionDefinition(type), __TypeKind.ENUM => builder.AddEnumDefinition(type), __TypeKind.INPUT_OBJECT => builder.AddInputObjectDefinition(type), _ => throw new ArgumentOutOfRangeException(nameof(type), type.Kind, "Cannot add as schema type") });