Expose human readable ids in GraphQL
Currently, when we expose an id field in GraphQL, this is a Global id, uniquely identifying the object over the GitLab instance.
Sometimes, however, we want to have a friendlier identifier for this to present to users in (for example) URLs.
For some records, like issues and merge requests, this is an iid, which is an integer, which is unique within a scope (in the case of issues, this is a project).
For other records (like ContainerRepository) we don't have a field like this. As a workaround, our frontend currently parses the database-id out of the Global id. Because using the entire global id here would look unattractive in URLs. This indicates the need for having an identifier that can be used to pass into the router to identify a resource.
I think the most boring solution to this problem might be to add the database id as a String or Int type to all of our types. So this can be requested by clients to present to users if they need to.
-
@reprazent started a discussion: (+11 comments)
This worries me a bit. The Global ids shouldn't really be parsed anywhere but our backend to load records. They should also not be built anywhere outside the backend.
Why is this value needed?