Node fields and ids with clean URLs
See original GitHub issueI’m using Graphene with Django and Relay (and react-router-relay), but struggling to figure out a good way of:
- Having an entry point of say
/thread/:id/
whereid
is the plain ID of a Django model instance (ie. a simple number like 7, so/thread/7/
) - Using this with GraphQL fragments to query a node where id needs to be the opaque global ID, eg:
fragment on Viewer {
thread(id: "VGhyZWFkVHlwZToxMjU2OQ==") {
...
}
}
With the way Graphene-Django works when you modify your schemas for Relay, there doesn’t seem to be any way to query a node without that global ID.
Is this intentional? If so, how are you supposed to get from one form of ID to the other in your logic? The project I’m working on currently works with fine with the global ID in the URL, but that’s a really ugly and long URL in comparison to just the simple ID.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Why are IDs showing in URLs when clean URLs are enabled?
The Clean URLs setting turns your URLs from index.php?q=node/123 to /node/123 . The path module that comes with core Drupal enables the URL ......
Read more >Clean URLs (possibly with slug) - node.js - Stack Overflow
Works fine. But is there any way to auto increment Numbers and save a custom ID (with a field name like, serial_number)?. I...
Read more >How to see the Node ID (nid) of a given Node in Drupal 7 if ...
It is quite simple really, but not the most obvious. When you first install Drupal and create nodes (with Clean URLs turned on),...
Read more >Replace serial entity IDs with UUIDs in URLs, or even globally?
Also this system would be half-baked without auto-increment field (serial field) because a lot of systems already use serial node IDs for ...
Read more >When to use Drupal paths instead of aliases - InterWorks
Putting in node IDs ensures that the menu will always link to the correct path alias. Path redirects would keep users from encountering...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
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
@matthewjohnston4 so far here is my understanding of using Node and filters w/o relay:
@syrusakbary any thoughts of how to decouple filtering/node from relay?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.