Skip to content

Commit

Permalink
Merge pull request #442 from polywrap/prealpha-dev
Browse files Browse the repository at this point in the history
Prep 0.0.1-prealpha.34
  • Loading branch information
dOrgJelli authored Aug 20, 2021
2 parents 8dc9e5e + 47025c9 commit ee061ba
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Web3API 0.0.1-prealpha.34
## Bugs
* `@web3api/schema-bind`: Fix TypeScript enum bindings.
* `@web3api/graph-node-plugin-js`: Fix mismatched schema.

# Web3API 0.0.1-prealpha.33
## Bugs
* `@web3api/schema-bind`: Fixed plugin code generation oversight. Should be using `null` instead of `undefined`.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1-prealpha.33
0.0.1-prealpha.34
7 changes: 3 additions & 4 deletions packages/js/plugins/graph-node/schema.graphql
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
type Query {
querySubgraph(
subgraphId: String!
subgraphAuthor: String!
subgraphName: String!
query: String!
): String! """JSON!"""
"""TODO: support JSON type as base type?"""
"""I think this would be helpful for dynamic data"""
): String!
}
6 changes: 4 additions & 2 deletions packages/js/plugins/graph-node/src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ export const manifest: PluginPackageManifest = {
schema: `
type Query {
querySubgraph(
subgraphId: String!
subgraphAuthor: String!
subgraphName: String!
query: String!
): String!
}`,
}
`,
implements: [],
};
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,19 @@ export interface {{type}} {

{{/objectTypes}}
{{#enumTypes}}
export enum {{type}} {
enum {{type}}Enum {
{{#constants}}
{{.}},
{{/constants}}
}

type {{type}}String =
{{#constants}}
| "{{.}}"
{{/constants}}

export type {{type}} = {{type}}Enum | {{type}}String;

{{/enumTypes}}
/// Imported Objects START ///

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,17 @@ export interface AnotherType {
circular?: Types.CustomType | null;
}

export enum CustomEnum {
enum CustomEnumEnum {
STRING,
BYTES,
}

type CustomEnumString =
| "STRING"
| "BYTES"

export type CustomEnum = CustomEnumEnum | CustomEnumString;

/// Imported Objects START ///

/* URI: "testimport.uri.eth" */
Expand Down

0 comments on commit ee061ba

Please sign in to comment.