Skip to content
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

Relay Preset adds combo pk/fk to update patch #2334

Open
jcgsville opened this issue Jan 23, 2025 · 0 comments
Open

Relay Preset adds combo pk/fk to update patch #2334

jcgsville opened this issue Jan 23, 2025 · 0 comments
Labels

Comments

@jcgsville
Copy link
Contributor

Summary

If you create a table foo whose primary key is also a foreign key, the update patch incorrectly includes the primary key, even though the DB does not allow you to update the value of the primary key.

Steps to reproduce

create table foo (id int primary key);
create table bar (id int primary key references foo.id, val text);

Relevant parts of my preset:

ts

  extends: [
    PostGraphileAmberPreset,
    PostGraphileRelayPreset,
    PgSimplifyInflectionPreset,
  ],
  schema: {
    pgSimplifyAllRows: false,
    pgShortPk: false,
  },
  plugins: [
    SmartTagsPlugin,

Expected results

input BarPatch {
  val: String
}

Actual results

input BarPatch {
  val: String
  foo: ID
}

Additional context

node --version
v22.12.0
    "@dataplan/json": "0.0.1-beta.28",
    "@dataplan/pg": "0.0.1-beta.30",
    "@graphile/simplify-inflection": "8.0.0-beta.5",
    "graphile-build": "5.0.0-beta.31",
    "graphile-build-pg": "5.0.0-beta.36",
    "postgraphile": "5.0.0-beta.37"

From Benjie, on Discord:

This is the Relay preset tweaking behaviour haphazardly
It’s probably something like -update:nodeId
Please file an issue; this will be a breaking change so needs to go out before release

Possible Solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🌳 Triage
Development

No branches or pull requests

1 participant