Skip to content

How to specify the primary key of a type? #33

@allthesignals

Description

@allthesignals

Hi, I'm using the json-api serializer with this adapter. JSON API serializer throws an error about toString of undefined— it's trying to stringify the id field received from Postgres, but that field is empty because it doesn't exist in the database.

In this adapter, I can get this to work by changing this and specifying my primary key:

const primaryKey = this.keys.primary

I can't figure out how to do this through the public API. Do I need to extend the class to specify a primary key? Would that be the only way to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions