-
Couldn't load subscription status.
- Fork 230
fix: generate types for mappings when int8 is used as id #1934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add | typeof IdField.INT8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is meant for line 21
| case 'Int8': | ||
| this.kind = IdField.INT8; | ||
| break; | ||
| default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add case 'string' for consistency and future refactoring
c6e324e to
40bf36d
Compare
|
@YaroShkvorets PR is ready for review |
No description provided.