How to declare custom global ID
See original GitHub issueCode
class ShipNode(DjangoObjectType):
class Meta:
model = Ship
filter_fields = ['id', 'size']
interfaces = (relay.Node, )
rowid = graphene.String()
@resolve_only_args
def resolve_rowid(self):
return self.id
class Query(object):
ship = relay.Node.Field(ShipNode)
all_ships = DjangoFilterConnectionField(ShipNode)
I have an id
field in my database which gets override when querying GraphQL server by the custom global ID. Using resolve_rowid
, I can get the id
I want, but I am unable to use it in the filters.
query {
ship(id: "124567") {
}
}
How can I filter based on my database’s primary key instead of the global ID? How can I rename global ID from id
to _id
?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Add Global IDs (Data Management)
ArcGIS geoprocessing tool that adds global IDs to a list of geodatabase feature classes, tables, and feature datasets.
Read more >Specifying the global ID attribute for users and groups
Decide if you will accept the default identifiers used by your LDAP directory server or create a custom attribute to be used as...
Read more >What are Global, Custom, and Family IDs?
What are Global, Custom, and Family IDs? ... There are three types of ID described below. ... Custom ID: a user defined ID...
Read more >Pass Global ID from Collector to G
Pass Global ID from Collector to G · The first field (let's cal it "incoming") should be a hidden field (or text, if...
Read more >Global ID
Global IDs are identifiers of items that are connected through synchronization. While every item has its own unique ID (which is also the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think the people behind the graphene-django missed out how confusing, frustrating and all other dirty epithets is to work with shadowed-out id of an object.
@webel