Skip to content

Commit

Permalink
refactor: combine cross-chain types for the 721 and 1155 subgraphs
Browse files Browse the repository at this point in the history
we were previous exporting an ERC721 and ERC1155 subgraph schema for each chain
this was a legacy pattern as each chain had a completely different format
however, we now have a consistent schema across all chains
this commit combines ERC721Mainnet and ERC721Sepolia into a single ERC721 schema
this commit combines ERC1155Mainnet and ERC1155Sepolia into a single ERC1155 schema

BREAKING CHANGE: any imports of the 721 or 1155 subgraph schemas will need to be updated
  • Loading branch information
jackmellis committed Mar 20, 2024
1 parent a681661 commit 1bfad43
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 1,909 deletions.
19 changes: 0 additions & 19 deletions packages/types/1155-sepolia.codegen.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# schema: https://gateway-arbitrum.network.thegraph.com/api/49f332ad234c93d2f07d2c085f1ca6d6/subgraphs/id/5C6JRVzKcE9AVbT7S71EycV8eEGcfkJB9gGsyTbHMVmN
schema: https://api.thegraph.com/subgraphs/name/nftx-project/1155-sepolia-data-nexus
generates:
./src/subgraph/1155-mainnet.ts:
./src/subgraph/1155.ts:
config:
useTypeImports: true
strictScalars: true
Expand Down
19 changes: 0 additions & 19 deletions packages/types/721-sepolia.codegen.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# schema: https://gateway-arbitrum.network.thegraph.com/api/49f332ad234c93d2f07d2c085f1ca6d6/subgraphs/id/CBf1FtUKFnipwKVm36mHyeMtkuhjmh4KHzY3uWNNq5ow
schema: https://api.thegraph.com/subgraphs/name/nftx-project/721-sepolia-data-nexus
generates:
./src/subgraph/721-mainnet.ts:
./src/subgraph/721.ts:
config:
useTypeImports: true
strictScalars: true
Expand Down
6 changes: 5 additions & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
"scripts": {
"lint": "eslint --fix -c ../../.eslintrc.js --ext ts,tsx src && tsc --noEmit",
"test": "echo \"no tests\"",
"codegen": "graphql-codegen -c nftx-v3.codegen.yml && graphql-codegen -c nftx-v3-uniswap.codegen.yml && graphql-codegen -c 721-sepolia.codegen.yml && graphql-codegen -c 1155-sepolia.codegen.yml && graphql-codegen -c 721-mainnet.codegen.yml && graphql-codegen -c 1155-mainnet.codegen.yml",
"codegen-nftx-v3": "graphql-codegen -c nftx-v3.codegen.yml",
"codegen-amm": "graphql-codegen -c nftx-v3-uniswap.codegen.yml",
"codegen-721": "graphql-codegen -c 721.codegen.yml",
"codegen-1155": "graphql-codegen -c 1155.codegen.yml",
"codegen": "yarn codegen-nftx-v3 && yarn codegen-amm && yarn codegen-721 && yarn codegen-1155",
"build": "rm -rf dist && tsc -d --outDir dist/ts --emitDeclarationOnly && mkdir dist/cjs && echo \"module.exports = {}\" > dist/cjs/index.js",
"prepublishOnly": "yarn codegen && yarn build"
},
Expand Down
Loading

0 comments on commit 1bfad43

Please sign in to comment.