-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat(api): Add session mutation #1176
Conversation
b1f7cb4
to
558136c
Compare
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 577881c:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why getTypeDefs should return the Platform?
channel?: Maybe<Scalars['String']>; | ||
country?: Maybe<Scalars['String']>; | ||
postalCode?: Maybe<Scalars['String']>; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah
|
||
channelParser.updateChannel({ regionId: regionData?.[0]?.id }) | ||
|
||
return { ...session, channel: channelParser.stringify() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why you chose to create this stringify function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the channel for all platforms is a string that should be handled only on the backend, for the front end is only a string.
223eaad
to
ac0798a
Compare
ac0798a
to
2fb1863
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
What's the purpose of this pull request?
This PR adds the session query.
How it works?
The Session returns only the channel and the country. This is a partial Session, just to allow implement the VTEX regionalization that needs the regionId, that's is inside the channel.
How to test it?
base.store
Deploy Previewvtex-sites/base.store#392
References