-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ISSUE-7985: The topics for the "Company User" mutations have been cre… #8104
Changes from 1 commit
95f991e
be51581
64ab872
a05d0f2
22b5d5d
0f79a2c
698c8db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,179 @@ | ||||||
| --- | ||||||
| group: graphql | ||||||
| title: createCompanyUser mutation | ||||||
| contributor_name: Atwix | ||||||
| contributor_link: https://www.atwix.com/ | ||||||
| b2b_only: true | ||||||
| --- | ||||||
|
|
||||||
| Use the `createCompanyUser` mutation to create a new company user or add a user from the existing customer for your company. | ||||||
|
|
||||||
| The `target_id` input attribute allows you to specify which node in the company structure will be the parent node of the company user. If you do not specify a value, the user will be assigned to the top-level (root) node of the company structure. | ||||||
|
|
||||||
| You can get the `target_id` and the `role_id` with the [`company`]({{page.baseurl}}/graphql/queries/company.html) query. | ||||||
|
|
||||||
| ## Syntax | ||||||
|
|
||||||
| ```graphql | ||||||
| mutation { | ||||||
| createCompanyUser( | ||||||
| input: CompanyUserCreateInput! | ||||||
| ) { | ||||||
| CreateCompanyUserOutput | ||||||
| } | ||||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| ## Example usage | ||||||
|
|
||||||
| The following example shows the minimal payload for adding a new customer to a customer's company. | ||||||
|
||||||
| The following example shows the minimal payload for adding a new customer to a customer's company. | |
| The following example shows the minimal payload to add a company user. Because a `targit_id` is not specified, Magento places the new company user at the top node of the company structure. |
Outdated
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.
| `email` | String! | Company user's email address | |
| `email` | String! | The company user's email address |
Outdated
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.
| `firstname` | String! | Company user's first name | |
| `firstname` | String! | The company user's first name |
Outdated
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.
| `lastname` | String! | Company user's last name | |
| `lastname` | String! | The company user's last name |
Outdated
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.
| `job_title` | String! | Company user's job title | |
| `job_title` | String! | The company user's job title or function |
Outdated
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.
| `role_id` | ID! | Company user's role ID | |
| `role_id` | ID! | The role ID to assign to the company user |
Outdated
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.
| `telephone` | String! | Company user's phone number | |
| `telephone` | String! | The company user's phone number |
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.
It would be great to have information about the default target ID (if not specified explicitly)
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.
Hello @rogyar
Thank you for your review.
It is described in the top paragraphs.
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.
Yes, this is the preferred method of documenting non-intuitive attributes and objects. The descriptions here should be very similar to the @description text in the schema file. Eventually, the GraphQL documentation will be auto-generated, and we don't want to lose critical information.
Outdated
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.
| `Invitation was sent to an existing customer, they will be added to your organization once they accept the invitation.` | The customer with email provided in the `input`.`email` argument belongs to an existing customer. The invitation was sent to an existing customer. The customer will assign to the company after accepting the invitation. | |
| `Invitation was sent to an existing customer, they will be added to your organization once they accept the invitation.` | The email provided in the `input`.`email` argument belongs to an existing customer. Magento will send an invitation to this customer. When the customer accepts the invitation, the customer will be assigned to the company. |
Outdated
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.
| `A customer with the same email already assigned to company.` | The email provided in the `input`.`email` argument belongs to an existing customer and the customer has already assigned to the company. | |
| `A customer with the same email already assigned to company.` | The email provided in the `input`.`email` argument belongs to an existing customer, and the customer has already been assigned to the company. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,76 @@ | ||||||
| --- | ||||||
| group: graphql | ||||||
| title: deleteCompanyUser mutation | ||||||
| contributor_name: Atwix | ||||||
| contributor_link: https://www.atwix.com/ | ||||||
| b2b_only: true | ||||||
| --- | ||||||
|
|
||||||
| Use the `deleteCompanyUser` mutation to deactivate a company user by ID. | ||||||
|
||||||
| Use the `deleteCompanyUser` mutation to deactivate a company user by ID. | |
| Use the `deleteCompanyUser` mutation to deactivate the specified company user. |
Outdated
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.
| The following example deactivates the user specified in ID. | |
| The following example deactivates the user specified in the `id` attribute. |
Outdated
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.
| `You do not have authorization to perform this action.` | The user with ID provided in the `input`.`id` argument not available to your company or you have no permissions for this operation. | |
| `You do not have authorization to perform this action.` | The user with ID provided in the `input`.`id` argument not available to your company, or you do not have the necessary permissions to perform this operation. |
Outdated
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.
| `You cannot delete yourself.` | You have no a possibility to deactivate yourself. | |
| `You cannot delete yourself.` | You must specify a company user other than yourself. |
Outdated
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.
| `A customer with the same email address already exists in an associated website` | The email provided in the `input`.`email` argument has already exist to another user. | |
| `A customer with the same email address already exists in an associated website` | The email provided in the `input`.`email` argument belongs to another user. |
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.
Who can run this mutation? Anyone with a customer/company user token? Do they need to have the "Manage users and teams" role permission?
Rewrite the first paragraph to be something like thuis
The
createCompanyUsermutation allows an existing company user with the role to create a new company user. The specified email address determines how Magento processes the request.A customer with the same email already assigned to company.