How to receive the native Model ID that stored in the DB (eg. django model ID) when we are executing the Relay query? The main issue that the Relay defines it's own ID so I'm not sure how can we correctly handle it.
For ex.
query {
allFuelTypes (codeMatch: "g") {
edges {
node {
id,
code,
label
}
}
}
}
will print
{
"data": {
"allFuelTypes": {
"edges": [
{
"node": {
"id": "RnVlbFR5cGVOb2RlOjM=",
"code": "g",
"label": "Gas"
}
}
]
}
}
}
Where id is the Graphene Relay ID but I'd like to see the Model ID.
The only one possible way that I see is just to create some alias in the graphene Schema for the Model ID field and manually fetch this ID from the Django Model. But perhaps there is existing some more dynamic way to achieve the same result?
Thanks for any help!
P.S. the implementation of the query isn't important. It's just a dummy demo