-
Notifications
You must be signed in to change notification settings - Fork 50
Open
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/[email protected]",
"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 migrateUser:
$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-devexpMetadata
Metadata
Assignees
Labels
No labels