Skip to content

Code examples

Typecell is an in-browser JS notebook we chose to demonstrate simple usage of wovin.

INFO

TBD - More examples to come

Minimal example

ts
import { retrievePubStream } from "@wovin/connect-nftstorage";
import { query } from "@wovin/core";

const { cid, dataStream } = await retrievePubStream("k51qzi5uqu5dkuhqguzpbzbx3w4ihnxiwjmra1t57k0vd3l1zt615e5pzcaho8");

const moviesQuery = query(dataStream, [
  { en: "?movieID", at: "movie/year", vl: 1987 },
  { en: "?movieID", at: "movie/director", vl: "?directorID" },
  { en: "?directorID", at: "person/name", vl: "?directorName" },
])
console.log(moviesQuery.records);

Open in Typecell

Basic queries & explanation

https://www.typecell.org/@wovin/public/wovin-basic-queries~dKyH2GyQ4xQMm

Inspired by the lovely people at Fission