-
Notifications
You must be signed in to change notification settings - Fork 152
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
magento/architecture#: GraphQl. Add a mutation for subscribe feature #367
magento/architecture#: GraphQl. Add a mutation for subscribe feature #367
Conversation
СС: @nrkapoor as a PO of GraphQL scope |
da80fb4
to
a00c6ec
Compare
} | ||
|
||
type SubscribeOutput { | ||
status: Int! @doc(description: "Returns a status of subscription") |
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.
Please introduce enum instead of int here.
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.
done
@@ -0,0 +1,7 @@ | |||
type Mutation { | |||
subscribeEmailToNewsletter(email: String!): SubscribeOutput @doc(description:"Adds an email into a newsletter subscription") |
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.
To be consistent with other mutations, please change output to SubscribeEmailToNewsletterOutput
(mutation name + suffix)
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.
done
Thank you!
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.
@paliarush , did you have a chance to review the applied changes?
Thank you!
a00c6ec
to
e388de7
Compare
e388de7
to
22c3327
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.
Looks good!
Problem
There is a subscribe field on a standard Magento storefront:
Currently, GraphQl does not have a mutation which allow to subscribe guest/customer into a newsletter subscription.
Solution
SubscribeOutput
.status
may return the next statuses:Depends on status the possible messages will be displayed, for example on PWA side:
SubscribeOutput
.status
= Not Active)PR: magento/magento2#27586
Issue in CORE repo: magento/magento2#27337
Requested Reviewers
Thank you!