`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
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
attributes do
attribute :id, :uuid
end
And told json_api about it:
json_api do
type "stuff"
primary_key :id
# ...
end
json_api do
type "stuff"
primary_key :id
# ...
end
But it doesn't seem happy still. Any ideas?
3 Replies
ZachDaniel
ZachDaniel3y ago
primary key do
keys [:foo_id, :bar_id]
delimiter "~"
end
primary key do
keys [:foo_id, :bar_id]
delimiter "~"
end
its looking for something like that
\ ឵឵឵
\ ឵឵឵OP3y ago
Morning mate Thanks!
ZachDaniel
ZachDaniel3y ago
np 😄

Did you find this page helpful?