strawberry
strawberry copied to clipboard
Quality of life improvements for GlobalIDs
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 😊
while adding these APIs should GlobalID be renamed to ID too? (reference: #3551 )
(existing PR: #3180 )
@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 I think that is unrelated - you can have an
IDscalar 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..