---
schema_version: "1"
id: 833764701d1dec5d3df2b79d48f61d7039e7fe65549f5f8fb7be1c73e82a0460
title: Enabling Object Type Collaboration in Anypoint DataGraph
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/datagraph/collaboration.md
canonical_url: https://docs.mulesoft.com/datagraph/collaboration
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 8f7e49df62a2747990896a7b9155e2ae6fe13f26d5a9bbb61b579efc8cae3bca
description: MuleSoft Documentation Site
latest: true
---
---
product: DataGraph
---

# Enabling Object Type Collaboration in Anypoint DataGraph

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Enabling collaboration on a Level-1 object type allows you to achieve a connected and enriched
unified schema.

When you enable collaboration on a type, you allow similar types in your API schema or in other API
schemas to collaborate with your type and directly add their own fields. The result is an extended
list of fields and dataset, resulting in a more enriched query result for this type.

When you enable collaboration on a type, the type provides its fields to other types in the unified
schema or in the local API schema, enabling you to:

- Create links between types  
  See [Link Types](https://docs.mulesoft.com/datagraph/linking) for more information.

- Merge types with other types  
  See [Merge Types](https://docs.mulesoft.com/datagraph/merge-types) for more information.

You can enable collaboration only on Level-1 object types: those directly returned from a query
method. See [Level-1 and Nested Types](https://docs.mulesoft.com/datagraph/schemas#level-1-and-nested-types) for more information.

To successfully understand the requirements for enabling collaboration, you must be familiar with
the types in your API schema. See [Understanding the Elements in an API Schema](https://docs.mulesoft.com/datagraph/schemas) for more
information.

## Default Query Method and Primary Keys

To enable collaboration on a type, you must configure a default query method and one or two primary
keys for that type to access its fields.

The default query method for an object type is the method that returns a single record of that
object type for which you want to enable collaboration. You can select a query method as the default
only if:

- It has one or two required input arguments.

- The input argument is a scalar data type (`Int`, `Float`, `String`, `Boolean`, or `ID`).

The primary key is one field of your object type that uniquely identifies a single record of that
object type. For a field to be a primary key, it must be visible and it should be non-nullable
(represented by a `!` sign at the end). If the query method uses two primary keys, those are
_composite keys_.

For example, to enable collaboration on the Order type of the following API schema:

```none
ordersById (id: ID!): Order
--------------------
--------------------
Order
--------------------
orderId: ID!
date: String
status: String
```

In this example, the default query method is `ordersById`, and its primary key is `orderId`.
`ordersById` retrieves the `Order` type and uses `orderId` to retrieve specific information based on
the `ID` field. Note that the data type of the default query method’s input argument `ID` must be
the same as the data type of the primary key. In this example, both are of data type `ID!`.

### Default Query Method with Composite Keys

In the following example using composite keys, the default query method is `productDetail` and its
composite keys are `productId` and `productSku`. Both retrieve the `Product` type and use
`productId` and `productSku` to retrieve specific information based on the `string` fields. Note
that the data type of the default query method’s input arguments must be the same as the data type
of each primary key. In this example, both are of data type `string!`:

```none
productDetail (id: String!, sku: String!): Product
--------------------
--------------------
Product
--------------------
productDetail: string!, string!
productId: String
productSku: String
```

## Enable Collaboration on an Object Type

1.  In the API schema navigation, select the Level-1 object type for which you want to enable
    collaboration.

2.  In the **Collaboration permissions** pane, click **Enable collaboration**.

3.  Set the default query method.

    The following image shows a query method that uses two mandatory arguments.

    ![A default query method that uses composite keys](/mulesoft/current/en-us/datagraph/_images/composite-keys-default-query-method.png)

4.  Click **Next**.

5.  Depending on your query method, select one or two primary keys.

    The following image shows composite keys since the query method uses two mandatory arguments.

    ![Two primary keys are selected](/mulesoft/current/en-us/datagraph/_images/composite-keys.png)

## Disable Collaboration for an Object Type

If you no longer want an object type to provide its fields to other types, you can disable
collaboration for that type. However, if you disable collaboration on an object that is merged with
another object type in the unified schema, the merge breaks and creates a conflict that you must
resolve.

To disable collaboration:

1.  Click **List of APIs added** and select the API that contains the object type for which you want
    to disable collaboration.

2.  In the API schema navigation, select the object type.

3.  In the **Collaboration permissions** pane, clear the selection for **Allow collaboration for
    this type (Extend this type).**

4.  When prompted, confirm that you want to disable collaboration for the object type by clicking
    **Undo merge and disable collaboration**.

5.  If a conflict occurs, follow the prompts in Anypoint DataGraph to resolve it.
