graphql-python / graphql-python/graphene-django
replace relay global id with object id
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 760
- PR merge metrics
- No merged PRs in 30d
Description
So basically I am trying to query through the objects using relay. when I fetch the id it returns the relay global id.
```python
{
allShops(first: 1){
edges{
node{
id
name
}
}
}
}
```
output
```pytho
{
"data": {
"allShops": {
"edges": [
{
"node": {
"id": "U2hvcE5vZGU6NTA4NTRhYTUtNzJmZC00NzNmLThhNTEtNmQxNWJjYWUwNjE5",
"name": "pops"
}
}
]
}
}
}
```
it works just fine , even filtering and stuff. But the problem occurs in mutation i cant pass the relay id while updating or referencing an entry in django. I want the object id there.
**A workaround I tried**
Use this function
```python
id = from_global_id(id)
```
its in graphql_relay.node.node
but the problem is it increases a lot of my code and everywhere I want i have to use this and I have a lot of code to manage already.
**Is there any way to globally replace relay global id with model id,(i am using Django's UUID field)
keeping two ids is redundant code*
Contributor guide
Assessment
This issue has not been assessed yet.