Ash FrameworkAF
Ash Framework3y ago
4 replies
\ ឵឵឵

`AshJsonApi` composite primary key

Would like to add AshJsonApi to a project currently using AshGraphql, getting complaints about my many_to_many resources:
 json_api -> primary_key:
  AshJsonApi requires primary key when a resource has a composite key

I have added a "pretend" primary key, because otherwise the table definitions are invalid:
attributes do
  attribute :id, :uuid
end

And told json_api about it:
json_api do
  type "stuff"
  primary_key :id
  # ...
end

But it doesn't seem happy still. Any ideas?
Was this page helpful?