Skip to content

Allow using Bytes as well as String/ID for the id of entities#3271

Merged
lutter merged 6 commits intomasterfrom
lutter/bytes
Feb 25, 2022
Merged

Allow using Bytes as well as String/ID for the id of entities#3271
lutter merged 6 commits intomasterfrom
lutter/bytes

Conversation

@lutter
Copy link
Collaborator

@lutter lutter commented Feb 24, 2022

This PR makes it possible to declare entities with an id type of Bytes; building on previous support that was committed a long time ago, with this PR, the Bytes are not converted to a string before handing them to mappings. Instead, such entities show up in the mappings with a bytes value for their ID. Companion PR's for graph-ts and graph-cli will make that more usable.

An example of what it takes to convert a subgraph to all Bytes ids can be found here

} else {
// For interfaces that are not implemented at all, pretend
// they have a String `id` field
// see also: id-type-for-unimplemented-interfaces
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woah I like this, less cryptic than the UUIDs 😅

Copy link
Contributor

@evaporei evaporei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@lutter lutter merged commit a67b455 into master Feb 25, 2022
@lutter lutter deleted the lutter/bytes branch February 25, 2022 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants