Skip to content
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

Quality of life improvements for GlobalIDs #3693

Open
patrick91 opened this issue Nov 11, 2024 · 3 comments
Open

Quality of life improvements for GlobalIDs #3693

patrick91 opened this issue Nov 11, 2024 · 3 comments

Comments

@patrick91
Copy link
Member

patrick91 commented Nov 11, 2024

I think we should add the following APIs:

GlobalID.from_str("Node:1")
GlobalID("Node", 1) # support for numbers
GlobalID(...).as_string() # not sure about the name, but it's nicer than str(GlobalID(...))

I'd use these in tests 😊

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@aryaniyaps
Copy link
Contributor

aryaniyaps commented Nov 12, 2024

while adding these APIs should GlobalID be renamed to ID too?
(reference: #3551 )

(existing PR: #3180 )

@erikwrede
Copy link
Member

@aryaniyaps I think that is unrelated - you can have an ID scalar in your schema even though it is not globally unique. Conversely, an ID in your schema can be a globally unique global ID. This ticket is only intended to make life easier with a specific standard of global IDs (Base64 "Typename:id").

@aryaniyaps
Copy link
Contributor

@aryaniyaps I think that is unrelated - you can have an ID scalar in your schema even though it is not globally unique. Conversely, an ID in your schema can be a globally unique global ID. This ticket is only intended to make life easier with a specific standard of global IDs (Base64 "Typename:id").

I can see that its unrelated to this issue, but I feel that putting it off will further burden migrations from GlobalID to ID.. right now the schema generated by default doesnt play well with relay, and a workaround is needed to make things work.. so I thought it would be worth bringing up that issue as well..

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

No branches or pull requests

3 participants