-
-
Notifications
You must be signed in to change notification settings - Fork 569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Independent usage options for nodeIds and row ids #714
Comments
It's possible to drop the Node plugin and lose all the
There is
Ultimately the reasoning for these things comes from Relay 1, and if you don't want them in the schema I'd be happy to merge a PR that adds a flag to simplify the schema to remove certain of them. As I mentioned before, I think it might be as simple as disabling NodePlugin. Seems the method to remove plugins is not documented yet, so I'll add that as a task |
@benjie that makes perfect sense, I don't know why I missed the If it is as simple as disabling the Maybe at some point I'll write a plugin for schema sugar like |
Following up here, how can I remove both the default generation of itemById(id: Int!), itemByUniqueKey1AndUniqueKey2(uniqueKey1: ..., and disable the NodePlugin ? Thanks! |
there is a --skip-plugins option in the docs. However running postgraphile with that option errors out. Thank you in advance! |
I spotted this a couple of days ago myself as it happens; please subscribe to this issue and it will be closed when the issue is resolved: graphile/graphile-engine#310 I'm going to add tests for specifically supporting this case. |
Fantastic, thanks for the quick reply and the great work on postgraphile!!! |
@benjie Related to this question, is there a setting to automatically generate a Relay (modern) compliant schema if the database already uses UUIDs for primary keys? Basically the classicIds setting, but using the existing id column since it is already globally unique? Any guidance would be greatly appreciated 😄 |
No, because the UUID does not encode in it which collection it is from, so given a UUID we do not know which table to retrieve the record from (and scanning through hundreds of tables to find it would be highly inefficient). You can replace the nodeId plugins with your own should you so choose, enabling you to solve this issue for your stack. |
@benjie Ok cool. Thanks for explaining the design choice and thanks for your help! |
I'm submitting a ...
PostGraphile version:
^4.0.0-beta.2
There are two aspects to this. postgraphile automatically generates
Query { item(nodeId: ID!): Item }
but not
Query { item(id: Int!): Item }
Parent { parentId: Int! childsByParentId }
but not
Parent { parentNodeId: ID! childsByParentNodeId }
This seems counter intuitive to me, as I would rather deal with one "identification abstraction" than two.
The text was updated successfully, but these errors were encountered: