0.12.2 • Published 6 months ago

@polywrap/schema-bind v0.12.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

@polywrap/schema-bind

Bind WRAP ABIs to a variety of supported languages through codegen.

Usage

import { BindOptions, BindOutput, bindSchema } from "@polywrap/schema-bind";
import { parseSchema } from "@polywrap/schema-parse";

const schema = fetch("schema.graphql");
const abi = parseSchema(schema);

const input: BindOptions = {
  projectName: "Test",
  bindLanguage: "wasm-as",
  abi,
  schema,
  outputDirAbs: "/path/to/output/dir"
};

const output: BindOutput = bindSchema(input);

Details

Polywrap uses MessagePack as a common data interchange format between languages. This allows Polywrap WASM modules, authored in different languages, to be run within a single host language (JS, Rust, Python, Go, C#, C++).

MessagePack encoded data is sent between module boundaries. Decoding of the message will happen in the destination environment, using generated binding code, created by this package.

Supported Schema Types

GraphQL Schema TypeMessagePack TypeDescription
UIntuint 3232-bit unsigned integer.
UInt8uint 88-bit unsigned integer.
UInt16uint 1616-bit unsigned integer.
UInt32uint 3232-bit unsigned integer.
Intint 3232-bit signed integer.
Int8int 88-bit signed integer.
Int16int 1616-bit signed integer.
Int32int 3232-bit signed integer.
Stringfixstr or str 8/16/32UTF-8 string.
Booleanbooltrue or false stored as 1 byte.
Bytesbin 8/16/32array of 8-bit unsigned integer.
BigIntfixstr or str 8/16/32UTF-8 string.
BigNumberfixstr or str 8/16/32UTF-8 string.
JSONfixstr or str 8/16/32UTF-8 string.
Typefixarray or array 16/32Array of elements.
MapMsgpack extention typeMap of key-value pairs.
type CustomObject {  prop: Type}fixmap or map 16/32Structured object.
0.11.0

9 months ago

0.11.1

9 months ago

0.11.2

9 months ago

0.11.3

8 months ago

0.11.4

8 months ago

0.12.0

8 months ago

0.12.1

7 months ago

0.11.0-pre.4

10 months ago

0.12.2

6 months ago

0.11.0-pre.2

10 months ago

0.11.0-pre.3

10 months ago

0.10.6

10 months ago

0.11.0-pre.0

10 months ago

0.11.0-pre.1

10 months ago

0.10.3

1 year ago

0.10.4

11 months ago

0.10.5

11 months ago

0.10.1

1 year ago

0.10.2

1 year ago

0.10.0-pre.14

1 year ago

0.10.0

1 year ago

0.9.7

1 year ago

0.10.0-pre.13

1 year ago

0.10.0-pre.12

1 year ago

0.10.0-pre.11

1 year ago

0.10.0-pre.10

1 year ago

0.9.6

1 year ago

0.9.5

1 year ago

0.10.0-pre.8

1 year ago

0.10.0-pre.7

1 year ago

0.10.0-pre.6

1 year ago

0.10.0-pre.3

1 year ago

0.10.0-pre.4

1 year ago

0.10.0-pre.1

1 year ago

0.10.0-pre.5

1 year ago

0.9.4

2 years ago

0.9.3

2 years ago

0.10.0-pre.0

2 years ago

0.9.0

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.8.0

2 years ago

0.5.0

2 years ago

0.4.1

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago