Skip to content

Conversation

@championswimmer
Copy link
Contributor

this is not a "ready to merge" PR.

I took at look at #320 and it is not adequate to properly support integer IDs
This PR is the entire kitchen sink we need to be able to properly support integer IDs in both graphql and jsonapi.

I need some guidance on how best can this be integrated ? (using a possible resourceConfig.generatedId option)

Signed-off-by: Arnav Gupta <[email protected]>
Signed-off-by: Arnav Gupta <[email protected]>
theirResource = _.assign(
{
id: uuid.v4(),
id: 0,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is 0 here as a "DEFAULT" value.
Putting the onus on the store handler (relattionaldb) to treat 0 = DEFAULT and if the value is 0, then generate new id, if not 0, then use it like a client provided id.

see championswimmer/jsonapi-store-sequelize@ee0b9f0#diff-8004fa36f21fa5eeb3c49b89106f6942R9 for example implementation

@pmcnr-hx
Copy link
Contributor

Now that we've merged #320, and as explained there the spec requires the id to be a string, do we still need this PR @championswimmer, or can we close it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants