This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ISSUE-7987: The GraphQL topic "Company team mutations" has been creat…
…ed (#8028) * ISSUE-7987: The topic "Company team mutations" has been created * ISSUE-7987: Fixes according to reviewer proposal * Update company-team.md * Update company-team-mutations.md * Update company-team.md * Update company-team-mutations.md * ISSUE-7987: Small fixes - separating the topics; - adding the links * Update graphql.yml * Small fixes Co-authored-by: Kevin Harper <[email protected]>
- Loading branch information
1 parent
abb7604
commit 2f1dd22
Showing
6 changed files
with
425 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
The `CompanyTeam` object contains details about a company team. It contains the following attributes. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`description` | String | An optional description of the team | ||
`id` | ID! | A string that contains the encoded team ID | ||
`name` | String | The display name of the team |
127 changes: 127 additions & 0 deletions
127
src/guides/v2.4/graphql/mutations/create-company-team.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
--- | ||
group: graphql | ||
title: createCompanyTeam mutation | ||
contributor_name: Atwix | ||
contributor_link: https://www.atwix.com/ | ||
b2b_only: true | ||
--- | ||
|
||
Use the `createCompanyTeam` mutation to create a new team 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 team. If you do not specify a value, the team will be assigned to the top-level (root) node of the company structure. | ||
|
||
You can get the `target_id` with the [`company`]({{page.baseurl}}/graphql/queries/company.html) query. | ||
|
||
## Syntax | ||
|
||
```graphql | ||
mutation { | ||
createCompanyTeam( | ||
input: CompanyTeamCreateInput! | ||
) { | ||
CreateCompanyTeamOutput | ||
} | ||
} | ||
``` | ||
|
||
## Example usage | ||
|
||
The following example shows the minimal payload for adding a new team to a customer's company. | ||
|
||
**Request:** | ||
|
||
```graphql | ||
mutation { | ||
createCompanyTeam( | ||
input: { | ||
name: "Test Team" | ||
} | ||
) { | ||
team { | ||
id | ||
name | ||
description | ||
} | ||
} | ||
} | ||
``` | ||
|
||
**Response:** | ||
|
||
```json | ||
{ | ||
"data": { | ||
"createCompanyTeam": { | ||
"team": { | ||
"id": "MQ==", | ||
"name": "Test Team", | ||
"description": null | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
This example creates a child team of the parent team specified in the `target_id` field. | ||
|
||
**Request:** | ||
|
||
```graphql | ||
mutation { | ||
createCompanyTeam( | ||
input: { | ||
name: "Test Child Team" | ||
description: "Test Child Team description" | ||
target_id: "MQ==" | ||
} | ||
) { | ||
team { | ||
id | ||
name | ||
description | ||
} | ||
} | ||
} | ||
``` | ||
|
||
**Response:** | ||
|
||
```json | ||
{ | ||
"data": { | ||
"createCompanyTeam": { | ||
"team": { | ||
"id": "Mg==", | ||
"name": "Test Child Team", | ||
"description": "Test Child Team description" | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Input attributes | ||
|
||
The `CompanyTeamCreateInput` input object defines the company team data. | ||
|
||
### CompanyTeamCreateInput attributes {#CompanyTeamCreateInput} | ||
|
||
The `CompanyTeamCreateInput` object contains the following attributes: | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`description` | String | An optional description of the team | ||
`name` | String! | The display name of the team | ||
`target_id` | ID | The ID of a node within a company's structure. This ID will be the parent of the created team | ||
|
||
## Output attributes | ||
|
||
The `CreateCompanyTeamOutput` output object contains the following attribute: | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`team` | CompanyTeam! | Contains company team data | ||
|
||
### CompanyTeam attributes {#CompanyTeam} | ||
|
||
{% include graphql/company-team.md %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
group: graphql | ||
title: deleteCompanyTeam mutation | ||
contributor_name: Atwix | ||
contributor_link: https://www.atwix.com/ | ||
b2b_only: true | ||
--- | ||
|
||
Use the `deleteCompanyTeam` mutation to delete a company team by ID. You can get the team ID with the [`company`]({{page.baseurl}}/graphql/queries/company.html) query. | ||
|
||
## Syntax | ||
|
||
```graphql | ||
mutation { | ||
deleteCompanyTeam( | ||
id: ID! | ||
) { | ||
DeleteCompanyTeamOutput | ||
} | ||
} | ||
``` | ||
|
||
## Example usage | ||
|
||
The following example deletes the specified team. | ||
|
||
**Request:** | ||
|
||
```graphql | ||
mutation { | ||
deleteCompanyTeam( | ||
id: "Mg==" | ||
) { | ||
success | ||
} | ||
} | ||
``` | ||
|
||
**Response:** | ||
|
||
```json | ||
{ | ||
"data": { | ||
"deleteCompanyTeam": { | ||
"success": true | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Input attributes | ||
|
||
The `deleteCompanyTeam` mutation requires the following input: | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`id` | ID! | The encoded team ID to delete | ||
|
||
## Output attributes | ||
|
||
The `deleteCompanyTeam` mutation returns a Boolean value that indicates whether the operation was successful. |
121 changes: 121 additions & 0 deletions
121
src/guides/v2.4/graphql/mutations/update-company-structure.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
--- | ||
group: graphql | ||
title: updateCompanyStructure mutation | ||
contributor_name: Atwix | ||
contributor_link: https://www.atwix.com/ | ||
b2b_only: true | ||
--- | ||
|
||
Use the `updateCompanyStructure` mutation to change the parent node of a company team. | ||
|
||
## Syntax | ||
|
||
```graphql | ||
mutation { | ||
updateCompanyStructure( | ||
input: CompanyStructureUpdateInput! | ||
) { | ||
UpdateCompanyStructureOutput | ||
} | ||
} | ||
``` | ||
|
||
## Example usage | ||
|
||
The following example shows how to update the customer's company structure. | ||
|
||
**Request:** | ||
|
||
```graphql | ||
mutation { | ||
updateCompanyStructure( | ||
input: { | ||
tree_id: "Mw==" | ||
parent_tree_id: "MQ==" | ||
} | ||
) { | ||
company { | ||
structure( | ||
rootId: "MQ==" | ||
) { | ||
items { | ||
id | ||
parent_id | ||
entity { | ||
... on CompanyTeam { | ||
name | ||
id | ||
description | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
**Response:** | ||
|
||
```json | ||
{ | ||
"data": { | ||
"updateCompanyStructure": { | ||
"company": { | ||
"structure": { | ||
"items": [ | ||
{ | ||
"id": "MQ==", | ||
"parent_id": "MA==", | ||
"entity": {} | ||
}, | ||
{ | ||
"id": "Mg==", | ||
"parent_id": "MQ==", | ||
"entity": { | ||
"name": "Test Team", | ||
"id": "MQ==", | ||
"description": "Test Team description" | ||
} | ||
}, | ||
{ | ||
"id": "Mw==", | ||
"parent_id": "Mg==", | ||
"entity": { | ||
"name": "Test Child Team", | ||
"id": "Mg==", | ||
"description": "Test Child Team dexription" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Input attributes | ||
|
||
The `CompanyStructureUpdateInput` input object defines the company team data. | ||
|
||
### CompanyStructureUpdateInput attributes {#CompanyStructureUpdateInput} | ||
|
||
The `CompanyStructureUpdateInput` object contains the following attributes: | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`parent_tree_id` | ID! | The ID of a company that will be the new parent | ||
`tree_id` | ID! | The ID of the company team that is being moved to another parent | ||
|
||
You can get the `parent_tree_id` and `tree_id` with the [`company`]({{page.baseurl}}/graphql/queries/company.html) query. | ||
|
||
## Output attributes | ||
|
||
The `UpdateCompanyStructureOutput` output object contains the following attribute: | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`company` | Company! | Contains company data | ||
|
||
{% include graphql/company.md %} |
Oops, something went wrong.