Skip to content
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

Wishlist Update schemas with UID changes #454

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions design-documents/graph-ql/coverage/customer/Wishlist.graphqls
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
type Mutation {
createWishlist(name: String!): ID # Multiple wishlists Commerce functionality
removeWishlist(id: ID!): Boolean # Commerce fucntionality - in Opens Source we assume customer always has one wishlist
removeWishlist(uid: ID!): Boolean # Commerce fucntionality - in Opens Source we assume customer always has one wishlist
addProductsToWishlist(wishlistId: ID!, wishlistItems: [WishlistItemInput!]!): AddProductsToWishlistOutput
removeProductsFromWishlist(wishlistId: ID!, wishlistItemsIds: [ID!]!): RemoveProductsFromWishlistOutput
updateProductsInWishlist(wishlistId: ID!, wishlistItems: [WishlistItemUpdateInput!]!): UpdateProductsInWishlistOutput
}

type Customer {
wishlist: Wishlist! @deprecated(reason: "Use `Customer.wishlists` or `Customer.wishlist_v2")
wishlist_v2(id: ID!): Wishlist # This query will be added in the ce
wishlist_v2(uid: ID!): Wishlist # This query will be added in the ce
Copy link
Member

Choose a reason for hiding this comment

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

We should just deprecate wishlist field and use new field wishlists, which will always have one item in Open Source.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@melnikovi I see, you have updated the schema file, Is there a need to do any additional changes to the schema file?

Copy link
Contributor

Choose a reason for hiding this comment

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

what he means here is we should either add wishlist_v3
However we decided to make id not required and add uid also as not required

wishlist_v2(id: ID, uid: ID) - in the code we will make at least 1 that's required but not through schema
adding wishlist_v3 for this is kind of intrusive.

wishlists: [Wishlist!]! @doc(description: "Customer wishlists are limited to a max of 1 wishlist in Magento Open Source") # This query will be added in the ce
}

type Wishlist {
id: ID
uid: ID
items: [WishlistItem] @deprecated(reason: "Use field `items_v3` from type `Wishlist` instead")
items_v2: [WishlistItemInterface] @doc(description: "An array of items in the customer's wishlist") @deprecated(reason: "Use field `items_v3` from type `Wishlist` instead")
items_v3(
Expand Down Expand Up @@ -61,7 +61,7 @@ input WishlistItemInput {
}

interface WishlistItemInterface {
id: ID
uid: ID
quantity: Float
description: String
added_at: String
Expand Down
8 changes: 4 additions & 4 deletions design-documents/graph-ql/coverage/customer/customer.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ type Mutation {
updateCustomer (input: CustomerInput!): CustomerOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\UpdateCustomer") @doc(description:"Update the customer's personal information")
revokeCustomerToken: RevokeCustomerTokenOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\RevokeCustomerToken") @doc(description:"Revoke the customer token")
createCustomerAddress(input: CustomerAddressInput!): CustomerAddress @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\CreateCustomerAddress") @doc(description: "Create customer address")
updateCustomerAddress(id: Int!, input: CustomerAddressInput): CustomerAddress @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\UpdateCustomerAddress") @doc(description: "Update customer address")
deleteCustomerAddress(id: Int!): Boolean @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\DeleteCustomerAddress") @doc(description: "Delete customer address")
updateCustomerAddress(uid: ID!, input: CustomerAddressInput): CustomerAddress @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\UpdateCustomerAddress") @doc(description: "Update customer address")
deleteCustomerAddress(uid: ID!): Boolean @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\DeleteCustomerAddress") @doc(description: "Delete customer address")
requestPasswordResetEmail(email: String!): Boolean @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\RequestPasswordResetEmail") @doc(description: "Request an email with a reset password token for the registered customer identified by the specified email.")
resetPassword(email: String!, resetPasswordToken: String!, newPassword: String!): Boolean @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\ResetPassword") @doc(description: "Reset a customer's password using the reset password token that the customer received in an email after requesting it using requestPasswordResetEmail.")
}
Expand Down Expand Up @@ -100,14 +100,14 @@ type Customer @doc(description: "Customer defines the customer name and address
dob: String @doc(description: "The customer's date of birth") @deprecated(reason: "Use `date_of_birth` instead")
date_of_birth: String @doc(description: "The customer's date of birth")
taxvat: String @doc(description: "The customer's Value-added tax (VAT) number (for corporate customers)")
id: Int @doc(description: "The ID assigned to the customer") @deprecated(reason: "id is not needed as part of Customer because on server side it can be identified based on customer token used for authentication. There is no need to know customer ID on the client side.")
uid: ID @doc(description: "The ID assigned to the customer") @deprecated(reason: "id is not needed as part of Customer because on server side it can be identified based on customer token used for authentication. There is no need to know customer ID on the client side.")
is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\IsSubscribed")
addresses: [CustomerAddress] @doc(description: "An array containing the customer's shipping and billing addresses") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\CustomerAddresses")
gender: Int @doc(description: "The customer's gender (Male - 1, Female - 2)")
}

type CustomerAddress @doc(description: "CustomerAddress contains detailed information about a customer's billing and shipping addresses"){
id: Int @doc(description: "The ID assigned to the address object")
uid: ID @doc(description: "The ID assigned to the address object")
customer_id: Int @doc(description: "The customer ID") @deprecated(reason: "customer_id is not needed as part of CustomerAddress, address ID (id) is unique identifier for the addresses.")
region: CustomerAddressRegion @doc(description: "An object containing the region name, region code, and region ID")
region_id: Int @doc(description: "The unique ID for a pre-defined region") @deprecated(reason: "Use `region` instead.")
Expand Down
26 changes: 13 additions & 13 deletions design-documents/graph-ql/coverage/customer/gift-registry.graphqls
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
type Customer {
gift_registry_list: [GiftRegistry]
gift_registry(id: ID!): GiftRegistry
Copy link
Contributor

Choose a reason for hiding this comment

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

we already took care of gift registy. please remove this scope from your PR

gift_registry(uid: ID!): GiftRegistry
}

type Query {
Expand All @@ -11,15 +11,15 @@ type Query {
giftRegistryTypeId: ID,
searchableDynamicAttributes: [GiftRegistryDynamicAttributeInput] @doc(description: "For select attributes ID should be provided expected. For range search, '_from' and '_to' suffixes can be added to the attribute code. For text attributes provide value for exact matching.")
): [GiftRegistry] @doc(description: "Gift registry search by registrant name and additional searchable attributes.")
giftRegistry(id: ID!): GiftRegistry @doc(description: "This query is intended for guests and some fields of GiftRegistry will not be availalbe")
giftRegistry(uid: ID!): GiftRegistry @doc(description: "This query is intended for guests and some fields of GiftRegistry will not be availalbe")
}

type Mutation {
# All mutations below should only be accessible to the registry owner. Guest users should be getting authorization error

createGiftRegistry(giftRegistry: CreateGiftRegistryInput!): CreateGiftRegistryOutput
updateGiftRegistry(id: ID!, giftRegistry: UpdateGiftRegistryInput!): UpdateGiftRegistryOutput
removeGiftRegistry(id: ID!): RemoveGiftRegistryOutput
updateGiftRegistry(uid: ID!, giftRegistry: UpdateGiftRegistryInput!): UpdateGiftRegistryOutput
removeGiftRegistry(uid: ID!): RemoveGiftRegistryOutput

addGiftRegistryItems(giftRegistryId: ID!, items: [AddGiftRegistryItemInput!]!): AddGiftRegistryItemsOutput
removeGiftRegistryItems(giftRegistryId: ID!, itemIds: [ID!]!): RemoveGiftRegistryItemsOutput
Expand All @@ -29,7 +29,7 @@ type Mutation {
updateGiftRegistryRegistrants(giftRegistryId: ID!, registrants: [UpdateGiftRegistryRegistrantInput!]!): UpdateGiftRegistryRegistrantsOutput
removeGiftRegistryRegistrants(giftRegistryId: ID!, registrantIds: [ID!]!): RemoveGiftRegistryRegistrantsOutput

shareGiftRegistry(id: ID!, sender: ShareGiftRegistrySenderInput!, invitees: [ShareGiftRegistryInviteeInput!]!): ShareGiftRegistryOutput
shareGiftRegistry(uid: ID!, sender: ShareGiftRegistrySenderInput!, invitees: [ShareGiftRegistryInviteeInput!]!): ShareGiftRegistryOutput
}

input ShareGiftRegistryInviteeInput
Expand Down Expand Up @@ -58,12 +58,12 @@ input AddGiftRegistryItemInput {

# Should be defined in scope of https://github.com/magento/architecture/blob/master/design-documents/graph-ql/coverage/add-items-to-cart-single-mutation.md
input EnteredOptionInput {
id: String!
uid: String!
value: String!
}

input UpdateGiftRegistryItemInput {
id: ID!
uid: ID!
quantity: Float!
note: String
}
Expand All @@ -79,7 +79,7 @@ input UpdateGiftRegistryInput {
}

input CreateGiftRegistryInput {
id: ID @doc(description: "Optional id, can be generated on the client and used for sending multiple gift-registry related mutations in a single request. For example, create registry and immediatly add items or registrants.")
uid: ID @doc(description: "Optional id, can be generated on the client and used for sending multiple gift-registry related mutations in a single request. For example, create registry and immediatly add items or registrants.")
event_name: String!
type_id: String!
message: String!
Expand All @@ -95,7 +95,7 @@ input GiftRegistryShippingAddressInput @doc(description: "Either address data or
}

input UpdateGiftRegistryRegistrantInput {
id: ID!
uid: ID!
first_name: String
last_name: String
email: String
Expand Down Expand Up @@ -155,7 +155,7 @@ type ShareGiftRegistryOutput {
}

type GiftRegistryType {
id: ID!
uid: ID!
label: String!
dynamic_attributes_metadata: [GiftRegistryDynamicAttributeMetadataInterface]
}
Expand Down Expand Up @@ -224,7 +224,7 @@ type GiftRegistrySelectAttributeOptionMetadata {
}

type GiftRegistry {
id: ID!
uid: ID!
event_name: String!
type: GiftRegistryType
message: String!
Expand All @@ -239,7 +239,7 @@ type GiftRegistry {
}

interface GiftRegistryItemInterface {
id: String!
uid: String!
quantity: Float!
quantity_fulfilled: Float!
note: String
Expand Down Expand Up @@ -301,7 +301,7 @@ enum GiftRegistryDynamicAttributeGroup {
}

type GiftRegistryRegistrant {
id: ID!
uid: ID!
first_name: String!
last_name: String!
email: String! @doc(description: "Accessible to the registry owner only")
Expand Down