From 46c4be8a1a01c16d034e6ca9a398fbc8811bb5e8 Mon Sep 17 00:00:00 2001 From: dOrgJelli Date: Tue, 26 Apr 2022 00:32:20 -0600 Subject: [PATCH] fix cli plugin tests --- packages/cli/src/__tests__/e2e/plugin.spec.ts | 2 +- .../expected/build-artifacts/schema.graphql | 393 ++++++++++++++++++ .../build-artifacts/web3api.plugin.json | 15 + .../expected/build-artifacts/schema.graphql | 291 +++++++++++++ .../build-artifacts/web3api.plugin.json | 11 + .../expected/build-artifacts/schema.graphql | 64 +++ .../build-artifacts/web3api.plugin.json | 15 + .../expected/build-artifacts/schema.graphql | 64 +++ .../build-artifacts/web3api.plugin.json | 15 + .../expected/build-artifacts/schema.graphql | 80 ++++ .../build-artifacts/web3api.plugin.json | 15 + 11 files changed, 964 insertions(+), 1 deletion(-) create mode 100644 packages/test-cases/cases/cli/plugin/codegen/001-sanity/expected/build-artifacts/schema.graphql create mode 100644 packages/test-cases/cases/cli/plugin/codegen/001-sanity/expected/build-artifacts/web3api.plugin.json create mode 100644 packages/test-cases/cases/cli/plugin/codegen/002-single-module/expected/build-artifacts/schema.graphql create mode 100644 packages/test-cases/cases/cli/plugin/codegen/002-single-module/expected/build-artifacts/web3api.plugin.json create mode 100644 packages/test-cases/cases/cli/plugin/codegen/003-env-shared/expected/build-artifacts/schema.graphql create mode 100644 packages/test-cases/cases/cli/plugin/codegen/003-env-shared/expected/build-artifacts/web3api.plugin.json create mode 100644 packages/test-cases/cases/cli/plugin/codegen/004-env-different/expected/build-artifacts/schema.graphql create mode 100644 packages/test-cases/cases/cli/plugin/codegen/004-env-different/expected/build-artifacts/web3api.plugin.json create mode 100644 packages/test-cases/cases/cli/plugin/codegen/005-env-sanitization/expected/build-artifacts/schema.graphql create mode 100644 packages/test-cases/cases/cli/plugin/codegen/005-env-sanitization/expected/build-artifacts/web3api.plugin.json diff --git a/packages/cli/src/__tests__/e2e/plugin.spec.ts b/packages/cli/src/__tests__/e2e/plugin.spec.ts index f137b18d88..17604a4b60 100644 --- a/packages/cli/src/__tests__/e2e/plugin.spec.ts +++ b/packages/cli/src/__tests__/e2e/plugin.spec.ts @@ -136,7 +136,7 @@ ${HELP}`); const expectedBuildResult = compareSync( `${testCaseDir}/build`, - `${testCaseDir}/expected/build`, + `${testCaseDir}/expected/build-artifacts`, { compareContent: true } ); diff --git a/packages/test-cases/cases/cli/plugin/codegen/001-sanity/expected/build-artifacts/schema.graphql b/packages/test-cases/cases/cli/plugin/codegen/001-sanity/expected/build-artifacts/schema.graphql new file mode 100644 index 0000000000..8b62cd22f5 --- /dev/null +++ b/packages/test-cases/cases/cli/plugin/codegen/001-sanity/expected/build-artifacts/schema.graphql @@ -0,0 +1,393 @@ +### Web3API Header START ### +scalar UInt +scalar UInt8 +scalar UInt16 +scalar UInt32 +scalar Int +scalar Int8 +scalar Int16 +scalar Int32 +scalar Bytes +scalar BigInt +scalar BigNumber +scalar JSON +scalar Map + +directive @imported( + uri: String! + namespace: String! + nativeType: String! +) on OBJECT | ENUM + +directive @imports( + types: [String!]! +) on OBJECT + +directive @capability( + type: String! + uri: String! + namespace: String! +) repeatable on OBJECT + +directive @enabled_interface on OBJECT + +directive @annotate(type: String!) on FIELD + +### Web3API Header END ### + +type Mutation @imports( + types: [ + "Ethereum_Mutation", + "Ethereum_Connection", + "Ethereum_TxOverrides", + "Ethereum_TxResponse", + "Ethereum_Access", + "Ethereum_TxReceipt", + "Ethereum_Log", + "Ethereum_TxRequest" + ] +) { + method( + arg: UInt32! + ): String! +} + +type Query @imports( + types: [ + "Ethereum_Query", + "Ethereum_Connection", + "Ethereum_TxOverrides", + "Ethereum_StaticTxResult", + "Ethereum_TxRequest", + "Ethereum_TxReceipt", + "Ethereum_Log", + "Ethereum_EventNotification", + "Ethereum_Network" + ] +) { + method( + str: String! + optStr: String + ): Object! +} + +type QueryEnv { + arg1: String! +} + +type Object { + u: UInt! + array: [Boolean!]! + bytes: Bytes +} + +### Imported Queries START ### + +type Ethereum_Mutation @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "Mutation" +) { + callContractMethod( + address: String! + method: String! + args: [String!] + connection: Ethereum_Connection + txOverrides: Ethereum_TxOverrides + ): Ethereum_TxResponse! + + callContractMethodAndWait( + address: String! + method: String! + args: [String!] + connection: Ethereum_Connection + txOverrides: Ethereum_TxOverrides + ): Ethereum_TxReceipt! + + sendTransaction( + tx: Ethereum_TxRequest! + connection: Ethereum_Connection + ): Ethereum_TxResponse! + + sendTransactionAndWait( + tx: Ethereum_TxRequest! + connection: Ethereum_Connection + ): Ethereum_TxReceipt! + + deployContract( + abi: String! + bytecode: String! + args: [String!] + connection: Ethereum_Connection + ): String! + + signMessage( + message: String! + connection: Ethereum_Connection + ): String! + + sendRPC( + method: String! + params: [String!]! + connection: Ethereum_Connection + ): String +} + +type Ethereum_Query @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "Query" +) { + callContractView( + address: String! + method: String! + args: [String!] + connection: Ethereum_Connection + ): String! + + callContractStatic( + address: String! + method: String! + args: [String!] + connection: Ethereum_Connection + txOverrides: Ethereum_TxOverrides + ): Ethereum_StaticTxResult! + + getBalance( + address: String! + blockTag: BigInt + connection: Ethereum_Connection + ): BigInt! + + encodeParams( + types: [String!]! + values: [String!]! + ): String! + + encodeFunction( + method: String! + args: [String!] + ): String! + + solidityPack( + types: [String!]! + values: [String!]! + ): String! + + solidityKeccak256( + types: [String!]! + values: [String!]! + ): String! + + soliditySha256( + types: [String!]! + values: [String!]! + ): String! + + getSignerAddress( + connection: Ethereum_Connection + ): String! + + getSignerBalance( + blockTag: BigInt + connection: Ethereum_Connection + ): BigInt! + + getSignerTransactionCount( + blockTag: BigInt + connection: Ethereum_Connection + ): BigInt! + + getGasPrice( + connection: Ethereum_Connection + ): BigInt! + + estimateTransactionGas( + tx: Ethereum_TxRequest! + connection: Ethereum_Connection + ): BigInt! + + estimateContractCallGas( + address: String! + method: String! + args: [String!] + connection: Ethereum_Connection + txOverrides: Ethereum_TxOverrides + ): BigInt! + + checkAddress( + address: String! + ): Boolean! + + toWei( + eth: String! + ): BigInt! + + toEth( + wei: BigInt! + ): String! + + awaitTransaction( + txHash: String! + confirmations: UInt32! + timeout: UInt32! + connection: Ethereum_Connection + ): Ethereum_TxReceipt! + + waitForEvent( + address: String! + event: String! + args: [String!] + timeout: UInt32 + connection: Ethereum_Connection + ): Ethereum_EventNotification! + + getNetwork( + connection: Ethereum_Connection + ): Ethereum_Network! +} + +### Imported Queries END ### + +### Imported Objects START ### + +type Ethereum_Connection @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "Connection" +) { + node: String + networkNameOrChainId: String +} + +type Ethereum_TxOverrides @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "TxOverrides" +) { + gasLimit: BigInt + gasPrice: BigInt + value: BigInt +} + +type Ethereum_TxResponse @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "TxResponse" +) { + hash: String! + to: String + from: String! + nonce: UInt32! + gasLimit: BigInt! + gasPrice: BigInt + data: String! + value: BigInt! + chainId: BigInt! + blockNumber: BigInt + blockHash: String + timestamp: UInt32 + confirmations: UInt32! + raw: String + r: String + s: String + v: UInt32 + type: UInt32 + accessList: [Ethereum_Access!] +} + +type Ethereum_Access @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "Access" +) { + address: String! + storageKeys: [String!]! +} + +type Ethereum_TxReceipt @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "TxReceipt" +) { + to: String! + from: String! + contractAddress: String! + transactionIndex: UInt32! + root: String + gasUsed: BigInt! + logsBloom: String! + transactionHash: String! + logs: [Ethereum_Log!]! + blockNumber: BigInt! + blockHash: String! + confirmations: UInt32! + cumulativeGasUsed: BigInt! + effectiveGasPrice: BigInt! + byzantium: Boolean! + type: UInt32! + status: UInt32 +} + +type Ethereum_Log @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "Log" +) { + blockNumber: BigInt! + blockHash: String! + transactionIndex: UInt32! + removed: Boolean! + address: String! + data: String! + topics: [String!]! + transactionHash: String! + logIndex: UInt32! +} + +type Ethereum_TxRequest @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "TxRequest" +) { + to: String + from: String + nonce: UInt32 + gasLimit: BigInt + gasPrice: BigInt + data: String + value: BigInt + chainId: BigInt + type: UInt32 +} + +type Ethereum_StaticTxResult @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "StaticTxResult" +) { + result: String! + error: Boolean! +} + +type Ethereum_EventNotification @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "EventNotification" +) { + data: String! + address: String! + log: Ethereum_Log! +} + +type Ethereum_Network @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "Network" +) { + name: String! + chainId: BigInt! + ensAddress: String +} + +### Imported Objects END ### diff --git a/packages/test-cases/cases/cli/plugin/codegen/001-sanity/expected/build-artifacts/web3api.plugin.json b/packages/test-cases/cases/cli/plugin/codegen/001-sanity/expected/build-artifacts/web3api.plugin.json new file mode 100644 index 0000000000..8fbbffeebe --- /dev/null +++ b/packages/test-cases/cases/cli/plugin/codegen/001-sanity/expected/build-artifacts/web3api.plugin.json @@ -0,0 +1,15 @@ +{ + "format": "0.0.1-prealpha.2", + "name": "Test", + "language": "plugin/typescript", + "modules": { + "mutation": { + "schema": "./src/mutation/schema.graphql", + "module": "./src/mutation/index.ts" + }, + "query": { + "schema": "./src/query/schema.graphql", + "module": "./src/query/index.ts" + } + } +} \ No newline at end of file diff --git a/packages/test-cases/cases/cli/plugin/codegen/002-single-module/expected/build-artifacts/schema.graphql b/packages/test-cases/cases/cli/plugin/codegen/002-single-module/expected/build-artifacts/schema.graphql new file mode 100644 index 0000000000..c44f5b7567 --- /dev/null +++ b/packages/test-cases/cases/cli/plugin/codegen/002-single-module/expected/build-artifacts/schema.graphql @@ -0,0 +1,291 @@ +### Web3API Header START ### +scalar UInt +scalar UInt8 +scalar UInt16 +scalar UInt32 +scalar Int +scalar Int8 +scalar Int16 +scalar Int32 +scalar Bytes +scalar BigInt +scalar BigNumber +scalar JSON +scalar Map + +directive @imported( + uri: String! + namespace: String! + nativeType: String! +) on OBJECT | ENUM + +directive @imports( + types: [String!]! +) on OBJECT + +directive @capability( + type: String! + uri: String! + namespace: String! +) repeatable on OBJECT + +directive @enabled_interface on OBJECT + +directive @annotate(type: String!) on FIELD + +### Web3API Header END ### + +type Query @imports( + types: [ + "Ethereum_Query", + "Ethereum_Connection", + "Ethereum_TxOverrides", + "Ethereum_StaticTxResult", + "Ethereum_TxRequest", + "Ethereum_TxReceipt", + "Ethereum_Log", + "Ethereum_EventNotification", + "Ethereum_Network" + ] +) { + method( + str: String! + optStr: String + ): Object! +} + +type QueryEnv { + arg1: String! +} + +type Object { + u: UInt! + array: [Boolean!]! + bytes: Bytes +} + +### Imported Queries START ### + +type Ethereum_Query @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "Query" +) { + callContractView( + address: String! + method: String! + args: [String!] + connection: Ethereum_Connection + ): String! + + callContractStatic( + address: String! + method: String! + args: [String!] + connection: Ethereum_Connection + txOverrides: Ethereum_TxOverrides + ): Ethereum_StaticTxResult! + + getBalance( + address: String! + blockTag: BigInt + connection: Ethereum_Connection + ): BigInt! + + encodeParams( + types: [String!]! + values: [String!]! + ): String! + + encodeFunction( + method: String! + args: [String!] + ): String! + + solidityPack( + types: [String!]! + values: [String!]! + ): String! + + solidityKeccak256( + types: [String!]! + values: [String!]! + ): String! + + soliditySha256( + types: [String!]! + values: [String!]! + ): String! + + getSignerAddress( + connection: Ethereum_Connection + ): String! + + getSignerBalance( + blockTag: BigInt + connection: Ethereum_Connection + ): BigInt! + + getSignerTransactionCount( + blockTag: BigInt + connection: Ethereum_Connection + ): BigInt! + + getGasPrice( + connection: Ethereum_Connection + ): BigInt! + + estimateTransactionGas( + tx: Ethereum_TxRequest! + connection: Ethereum_Connection + ): BigInt! + + estimateContractCallGas( + address: String! + method: String! + args: [String!] + connection: Ethereum_Connection + txOverrides: Ethereum_TxOverrides + ): BigInt! + + checkAddress( + address: String! + ): Boolean! + + toWei( + eth: String! + ): BigInt! + + toEth( + wei: BigInt! + ): String! + + awaitTransaction( + txHash: String! + confirmations: UInt32! + timeout: UInt32! + connection: Ethereum_Connection + ): Ethereum_TxReceipt! + + waitForEvent( + address: String! + event: String! + args: [String!] + timeout: UInt32 + connection: Ethereum_Connection + ): Ethereum_EventNotification! + + getNetwork( + connection: Ethereum_Connection + ): Ethereum_Network! +} + +### Imported Queries END ### + +### Imported Objects START ### + +type Ethereum_Connection @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "Connection" +) { + node: String + networkNameOrChainId: String +} + +type Ethereum_TxOverrides @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "TxOverrides" +) { + gasLimit: BigInt + gasPrice: BigInt + value: BigInt +} + +type Ethereum_StaticTxResult @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "StaticTxResult" +) { + result: String! + error: Boolean! +} + +type Ethereum_TxRequest @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "TxRequest" +) { + to: String + from: String + nonce: UInt32 + gasLimit: BigInt + gasPrice: BigInt + data: String + value: BigInt + chainId: BigInt + type: UInt32 +} + +type Ethereum_TxReceipt @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "TxReceipt" +) { + to: String! + from: String! + contractAddress: String! + transactionIndex: UInt32! + root: String + gasUsed: BigInt! + logsBloom: String! + transactionHash: String! + logs: [Ethereum_Log!]! + blockNumber: BigInt! + blockHash: String! + confirmations: UInt32! + cumulativeGasUsed: BigInt! + effectiveGasPrice: BigInt! + byzantium: Boolean! + type: UInt32! + status: UInt32 +} + +type Ethereum_Log @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "Log" +) { + blockNumber: BigInt! + blockHash: String! + transactionIndex: UInt32! + removed: Boolean! + address: String! + data: String! + topics: [String!]! + transactionHash: String! + logIndex: UInt32! +} + +type Ethereum_EventNotification @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "EventNotification" +) { + data: String! + address: String! + log: Ethereum_Log! +} + +type Ethereum_Network @imported( + uri: "ens/ethereum.web3api.eth", + namespace: "Ethereum", + nativeType: "Network" +) { + name: String! + chainId: BigInt! + ensAddress: String +} + +### Imported Objects END ### diff --git a/packages/test-cases/cases/cli/plugin/codegen/002-single-module/expected/build-artifacts/web3api.plugin.json b/packages/test-cases/cases/cli/plugin/codegen/002-single-module/expected/build-artifacts/web3api.plugin.json new file mode 100644 index 0000000000..6147308120 --- /dev/null +++ b/packages/test-cases/cases/cli/plugin/codegen/002-single-module/expected/build-artifacts/web3api.plugin.json @@ -0,0 +1,11 @@ +{ + "format": "0.0.1-prealpha.2", + "name": "Test", + "language": "plugin/typescript", + "modules": { + "query": { + "schema": "./src/query/schema.graphql", + "module": "./src/query/index.ts" + } + } +} \ No newline at end of file diff --git a/packages/test-cases/cases/cli/plugin/codegen/003-env-shared/expected/build-artifacts/schema.graphql b/packages/test-cases/cases/cli/plugin/codegen/003-env-shared/expected/build-artifacts/schema.graphql new file mode 100644 index 0000000000..d6c7da7f79 --- /dev/null +++ b/packages/test-cases/cases/cli/plugin/codegen/003-env-shared/expected/build-artifacts/schema.graphql @@ -0,0 +1,64 @@ +### Web3API Header START ### +scalar UInt +scalar UInt8 +scalar UInt16 +scalar UInt32 +scalar Int +scalar Int8 +scalar Int16 +scalar Int32 +scalar Bytes +scalar BigInt +scalar BigNumber +scalar JSON +scalar Map + +directive @imported( + uri: String! + namespace: String! + nativeType: String! +) on OBJECT | ENUM + +directive @imports( + types: [String!]! +) on OBJECT + +directive @capability( + type: String! + uri: String! + namespace: String! +) repeatable on OBJECT + +directive @enabled_interface on OBJECT + +directive @annotate(type: String!) on FIELD + +### Web3API Header END ### + +type Mutation { + method( + arg: UInt32! + ): String! +} + +type Query { + method( + str: String! + ): String! +} + +type QueryEnv { + arg1: String! +} + +type MutationEnv { + arg1: String! +} + +### Imported Queries START ### + +### Imported Queries END ### + +### Imported Objects START ### + +### Imported Objects END ### diff --git a/packages/test-cases/cases/cli/plugin/codegen/003-env-shared/expected/build-artifacts/web3api.plugin.json b/packages/test-cases/cases/cli/plugin/codegen/003-env-shared/expected/build-artifacts/web3api.plugin.json new file mode 100644 index 0000000000..8fbbffeebe --- /dev/null +++ b/packages/test-cases/cases/cli/plugin/codegen/003-env-shared/expected/build-artifacts/web3api.plugin.json @@ -0,0 +1,15 @@ +{ + "format": "0.0.1-prealpha.2", + "name": "Test", + "language": "plugin/typescript", + "modules": { + "mutation": { + "schema": "./src/mutation/schema.graphql", + "module": "./src/mutation/index.ts" + }, + "query": { + "schema": "./src/query/schema.graphql", + "module": "./src/query/index.ts" + } + } +} \ No newline at end of file diff --git a/packages/test-cases/cases/cli/plugin/codegen/004-env-different/expected/build-artifacts/schema.graphql b/packages/test-cases/cases/cli/plugin/codegen/004-env-different/expected/build-artifacts/schema.graphql new file mode 100644 index 0000000000..4ebc7ea55c --- /dev/null +++ b/packages/test-cases/cases/cli/plugin/codegen/004-env-different/expected/build-artifacts/schema.graphql @@ -0,0 +1,64 @@ +### Web3API Header START ### +scalar UInt +scalar UInt8 +scalar UInt16 +scalar UInt32 +scalar Int +scalar Int8 +scalar Int16 +scalar Int32 +scalar Bytes +scalar BigInt +scalar BigNumber +scalar JSON +scalar Map + +directive @imported( + uri: String! + namespace: String! + nativeType: String! +) on OBJECT | ENUM + +directive @imports( + types: [String!]! +) on OBJECT + +directive @capability( + type: String! + uri: String! + namespace: String! +) repeatable on OBJECT + +directive @enabled_interface on OBJECT + +directive @annotate(type: String!) on FIELD + +### Web3API Header END ### + +type Mutation { + method( + arg: UInt32! + ): String! +} + +type Query { + method( + str: String! + ): String! +} + +type QueryEnv { + queryArg: String! +} + +type MutationEnv { + mutationArg: String! +} + +### Imported Queries START ### + +### Imported Queries END ### + +### Imported Objects START ### + +### Imported Objects END ### diff --git a/packages/test-cases/cases/cli/plugin/codegen/004-env-different/expected/build-artifacts/web3api.plugin.json b/packages/test-cases/cases/cli/plugin/codegen/004-env-different/expected/build-artifacts/web3api.plugin.json new file mode 100644 index 0000000000..8fbbffeebe --- /dev/null +++ b/packages/test-cases/cases/cli/plugin/codegen/004-env-different/expected/build-artifacts/web3api.plugin.json @@ -0,0 +1,15 @@ +{ + "format": "0.0.1-prealpha.2", + "name": "Test", + "language": "plugin/typescript", + "modules": { + "mutation": { + "schema": "./src/mutation/schema.graphql", + "module": "./src/mutation/index.ts" + }, + "query": { + "schema": "./src/query/schema.graphql", + "module": "./src/query/index.ts" + } + } +} \ No newline at end of file diff --git a/packages/test-cases/cases/cli/plugin/codegen/005-env-sanitization/expected/build-artifacts/schema.graphql b/packages/test-cases/cases/cli/plugin/codegen/005-env-sanitization/expected/build-artifacts/schema.graphql new file mode 100644 index 0000000000..d994814aed --- /dev/null +++ b/packages/test-cases/cases/cli/plugin/codegen/005-env-sanitization/expected/build-artifacts/schema.graphql @@ -0,0 +1,80 @@ +### Web3API Header START ### +scalar UInt +scalar UInt8 +scalar UInt16 +scalar UInt32 +scalar Int +scalar Int8 +scalar Int16 +scalar Int32 +scalar Bytes +scalar BigInt +scalar BigNumber +scalar JSON +scalar Map + +directive @imported( + uri: String! + namespace: String! + nativeType: String! +) on OBJECT | ENUM + +directive @imports( + types: [String!]! +) on OBJECT + +directive @capability( + type: String! + uri: String! + namespace: String! +) repeatable on OBJECT + +directive @enabled_interface on OBJECT + +directive @annotate(type: String!) on FIELD + +### Web3API Header END ### + +type Mutation { + sanitizeEnv( + env: MutationClientEnv! + ): MutationEnv! + + method( + arg: UInt32! + ): String! +} + +type Query { + sanitizeEnv( + env: QueryClientEnv! + ): QueryEnv! + + method( + str: String! + ): String! +} + +type QueryClientEnv { + bar: UInt32! +} + +type QueryEnv { + queryArg: String! +} + +type MutationClientEnv { + foo: UInt32! +} + +type MutationEnv { + mutationArg: String! +} + +### Imported Queries START ### + +### Imported Queries END ### + +### Imported Objects START ### + +### Imported Objects END ### diff --git a/packages/test-cases/cases/cli/plugin/codegen/005-env-sanitization/expected/build-artifacts/web3api.plugin.json b/packages/test-cases/cases/cli/plugin/codegen/005-env-sanitization/expected/build-artifacts/web3api.plugin.json new file mode 100644 index 0000000000..8fbbffeebe --- /dev/null +++ b/packages/test-cases/cases/cli/plugin/codegen/005-env-sanitization/expected/build-artifacts/web3api.plugin.json @@ -0,0 +1,15 @@ +{ + "format": "0.0.1-prealpha.2", + "name": "Test", + "language": "plugin/typescript", + "modules": { + "mutation": { + "schema": "./src/mutation/schema.graphql", + "module": "./src/mutation/index.ts" + }, + "query": { + "schema": "./src/query/schema.graphql", + "module": "./src/query/index.ts" + } + } +} \ No newline at end of file