Blyx Nest Blyx language
Registry / Framework
framework · v0.1.0

Waxwing

Check the depth and weighted resolver cost of an expanded GraphQL field plan.

Source repository · Package JSON

Use Waxwing

use vendor::waxwing::waxwing;

Run the example

nest demo waxwing@0.1.0
blyxc native-run waxwing-demo/main.blyx
Example source and expected output
use vendor::waxwing::waxwing;

fn main() {
    let depths = [1, 2, 2];
    let units = [1, 3, 2];
    let visits = [1, 4, 2];
    let max_depth = 3.0;
    let budget = 15.0;
    let result = waxwing_budget(depths, units, visits, max_depth, budget);
    if len(result) == 0 { println!("invalid"); return; }
    let mut i = 0;
    while i < len(result) {
        println!(at(result, i));
        i += 1;
    }
}

Expected output

0
2
17
1

Published versions

VersionPackageSource commitSHA-256
0.1.0Download ZIP151d0acc7341fc8536299b03a655bb8d81acdd0d28f8861dea7ee243014f9fdab2140a7519