Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Polywrap Manifest: Improve imports #1920

Open
Assignees
@krisbitney

Description

Importing Wraps

Importing wraps is done within all projects that integrate polywrap: apps, plugins, wraps

Today's Devexp


polywrap.graphql

#import { function, Type } into Name from "global-uri"
#import ...
...

polywrap.yaml

format: "latest"
project:
 name: i-use-polywrap
 type: project/type
source:
 ...
 schema: ./polywrap.graphql
 # If the developer wanted to have
 # import stored locally, which is nice
 # for development, they'd need
 # this...
 # Not very intuitive.
 import_abis:
 - uri: "global-uri"
 abi: "local-uri"

Tomorrow's Devexp


polywrap.json

{
 "name": "i-love-polywrap",
 "version": "1.0.0",
 "type": "wrap/rust",
 "schema": "./polywrap.graphql",
 "sources": [
 "./src"
 ],
 "imports": {
 "Name": {
 "uri": "globbal-uri",
 "functions": ["function"]
 "types": ["Type"]
 },
 "Ethers": "wrapscan.io/polywrap/ethers@1.2",
 "Custom": "./imports/Custom/polywrap.graphql"
 }
}

polywrap.graphql

type Module {
 myCode(
 obj1: Object!
 obj2: Ethers_Object
 ): String!
}
type Object {
 prop: Name_Object
}

How do we get here, seamlessly?

Us:

It looks like your project is using an
older version of Polywrap.
Please run:
$polywrap migrate

User:

$polywrap migrate
(y/n) Polywrap project files will manipulated: y_
[.] Begin migration.
[.] Finding project format...
[=] Project Format: "0.5.0"
[.] Loading project files...
[=] Loaded: "polywrap.yaml"
[=] Loaded: "polywrap.graphql"
[=] Loaded: "polywrap.deploy.yaml"
[=] Loaded: "URI.txt"
[.] Migrating from 0.5.0 to 0.6.0...
[=] "name": "i-love-polywrap"
[=] "version": "1.0.0"
[=] "type": "wrap/rust"
[=] "schema": "./polywrap.graphql"
[=] "imports": {
[=] "Name": "..."
[=] "Ethers": "..."
[=] "Custom": "..."
[=] }
[.] Modifying project files...
[=] create: ./polywrap.json
[=] rewrite: ./polywrap.graphql
[=] delete: ./polywrap.yaml
[.] Migration complete.

Result:

GOTO tomorrows-devexp

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /