fix: generate types for mappings when int8 is used as id#1934
fix: generate types for mappings when int8 is used as id#1934YaroShkvorets merged 8 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 40bf36d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Deploying graph-tooling with
|
| Latest commit: |
40bf36d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1535b216.graph-tooling.pages.dev |
| Branch Preview URL: | https://shiyasmohd-int8-as-id-types.graph-tooling.pages.dev |
|
Is this PR finished? |
|
@YaroShkvorets PR is finished now |
|
@shiyasmohd Steps to reproduce:
Basically need to generate different code for Int8 that constructs unique 64-bit id for our event: I guess we could just hash this thing and take first 8 bytes in these cases. Or we could construct something from block number, transaction index and event index. UPD: nevermind, it's irrelevant since we scaffold |
YaroShkvorets
left a comment
There was a problem hiding this comment.
One last thing, can we add a test case in src/codegen/schema.test.ts
packages/cli/src/codegen/schema.ts
Outdated
| static STRING = Symbol('String'); | ||
| static INT8 = Symbol('Int8'); | ||
|
|
||
| private kind: typeof IdField.BYTES | typeof IdField.STRING; |
There was a problem hiding this comment.
add | typeof IdField.INT8
There was a problem hiding this comment.
This is meant for line 21
| case 'Int8': | ||
| this.kind = IdField.INT8; | ||
| break; | ||
| default: |
There was a problem hiding this comment.
let's add case 'string' for consistency and future refactoring
c6e324e to
40bf36d
Compare
|
@YaroShkvorets PR is ready for review |
No description provided.