这是indexloc提供的服务,不要输入任何密码
Skip to content

Relay hash id size #5037

@ro-savage

Description

@ro-savage

The current relay hash id is a has of a json representation of the table structure.

{"table" : {"schema" : "public", "name" : "test"}, "columns" : {"id" : 1}}
This generated a very long hash
eyJ0YWJsZSIgOiB7InNjaGVtYSIgOiAicHVibGljIiwgIm5hbWUiIDogInRlc3QifSwgImNvbHVtbnMiIDogeyJpZCIgOiAxfX0=

Is there a good reason to hash a json like this? instead of a minimal version?
public:test:1 which generates a hash of cHVibGljOnRlc3Q6MQ==

This id would be better for data transfer size and if people used the hash in the URL /projects/cHVibGljOnRlc3Q6MQ==

The advantage of a json would be that it's easier to decode and use if your app.

A side note, how does hasura relay handle multiple primary keys that are composite keys rather than an id field?

Metadata

Metadata

Assignees

Labels

c/relayRelated to GraphQL Relayc/serverRelated to server

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions