Skip to content

Conversation

@JamesReate
Copy link
Member

@JamesReate JamesReate commented Jul 28, 2025

Proposed Changes

  • instead of using the MMY attributes on the vehicle NFT, query tableland based on the definition_id on the vehicle NFT. We've been meaning to get rid of those for a bit and lately seeing more customer impacting bugs, so wanted to address it.
  • For performance, when querying multiple vehicles, it will group queries by manufacturer to reduce the number of network calls to tableland SQL Lite. This just uses a WHERE IN clause followed by the list of definition id's, with a max of 1000 (don't believe we'd allow paging bigger than 1k).

Background:
The definition ID is what drives what definition the vehicle is set to. Most clients will use the Make, Model, Year in the vehicle response from identity-api to show users their MMY. In the past, we had thought having the MMY on the vehicle nft made sense, but lately seems to add complexity/issues.
The objective of this PR is to solve for the user experience issues we've seen reported over time where the definition ID doesn't match the MMY.

@JamesReate JamesReate changed the title Read Definition MMY from definitions Read Vehicle Definition MMY from definitions by ID Jul 28, 2025
@JamesReate JamesReate marked this pull request as ready for review August 11, 2025 15:07
@elffjs
Copy link
Member

elffjs commented Aug 11, 2025

I would consider telling GQLGen that Vehicle.definition always needs a resolver, and then pretty much all of the new code (collecting definition ids, making the calls) would be inside of a loader. Does that make sense? I think it would cut down on the lift here.

@JamesReate
Copy link
Member Author

I would consider telling GQLGen that Vehicle.definition always needs a resolver, and then pretty much all of the new code (collecting definition ids, making the calls) would be inside of a loader. Does that make sense? I think it would cut down on the lift here.

I'll read up on GQLGen see how that works.

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.

2 participants