I also posted the same question on stackoverflow.
Here's one example of how long one global ID can be:
UHJvZmlsZUluZm9Tb2NpYWxMaW5rOjU3ZThmMjczODUwYTc5ZDM1ZDA1MDkxMA==
Its length is proportional to type name's length, so for some types with long names it becomes too wasteful...
Note that these IDs will be added to URLs like /user/:userId/posts/:postId.
Any strategies to shorten length of IDs?
How does Facebook tackle this problem?
Is there a way to use some kind of enum mapping for type names when forging global ids?
For example,
const typeEnum = {User: 1, Post: 2, ...};
And use the enum when encoding global ids instead of original type names?
It is not really "Relay"'s problem. It is a graphql-relay's issue. Or strictly speaking, it is not an issue at all.
You can override this function if you need something specific this https://github.com/graphql/graphql-relay-js/blob/v0.4.3/src/node/node.js#L87
@chungwong Thank you for the clarification!
Most helpful comment
It is not really "Relay"'s problem. It is a graphql-relay's issue. Or strictly speaking, it is not an issue at all.
You can override this function if you need something specific this https://github.com/graphql/graphql-relay-js/blob/v0.4.3/src/node/node.js#L87