-
-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 'id' getter MSTGQLRef #319
Conversation
@emckay hi, I'd be glad for you to see this PR because it's closely related to your changes. |
Thanks @weglov.. Will take a look this afternoon! |
Thanks for debugging this and sorry about introducing the breaking change! Right now, the problem you're running into is that if there's no delimiter in the id, then Would you mind updating your PR to return |
Looks good! @jesse-savary do you mind reviewing + merging this? |
Looks good, thank you @weglov |
@jesse-savary I will be happy if you published new version 🙂 14.0.1 |
Oops, still getting the hang of this. Will cut a release shortly! |
Published @weglov :) |
@jesse-savary Thank you, but you probably forgot to publish npm package, still 14.0.0 https://www.npmjs.com/package/mst-gql |
Odd, I'll take a look shortly |
@weglov resolved, apologies for the delay! I accidentally published |
This PR contains a small fix for getting the node.id in MSTGQLRef.
Problem:
When I create my mobxStore from a snapshot during testing, the models do not call a setter where their id must be modified and a separator added.
I got:
Failed to resolve reference to late(() => ItemModel.ItemModel)
, as you can see without id becouse id in this case just empty space''
So, this happens because in this case not fires this code: https://github.com/mobxjs/mst-gql/blob/main/src/MSTGQLObject.ts#L41-L43
And my solution will fix that, although I'm not sure if it's the right solution, but it works for me and theoretically can't cause problems.