# salesforceObjectFields

```graphql
query SalesforceObjectFields($projectReference: String!, $objectName: String!) {
  salesforceObjectFields(projectReference: $projectReference, objectName: $objectName) {
    data {
      name
      label
      type
      referenceTo
      relationshipName
      nillable
      createable
      updateable
      filterable
      sortable
      idLookup
      externalId
      calculated
      nameField
    }
    total
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
      prev
    }
  }
}
```

List the fields of one Salesforce object in the org connected to a project to map or filter its data; returns every field the connected user can see, or one page when a limit or cursor is sent. Requires project.integrations.read.

## Arguments

| Name               | Type    | Required | Description                                                                                                   |
| ------------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------- |
| `projectReference` | String! | Yes      |                                                                                                               |
| `objectName`       | String! | Yes      | Salesforce object API name.                                                                                   |
| `limit`            | Int     |          | Opt in to paging: fields per page, 1 to 100. Omit limit and cursor to read every field.                       |
| `cursor`           | String  |          | Opaque continuation from pageInfo.endCursor, at most 4096 characters. A cursor without limit reads 20 fields. |

## Variables

```json
{
  "projectReference": "string",
  "objectName": "string"
}
```

## Responses

| Status | Description                                                    |
| ------ | -------------------------------------------------------------- |
| 200    | The SalesforceObjectFieldList! in data.salesforceObjectFields. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query SalesforceObjectFields($projectReference: String!, $objectName: String!) {\n  salesforceObjectFields(projectReference: $projectReference, objectName: $objectName) {\n    data {\n      name\n      label\n      type\n      referenceTo\n      relationshipName\n      nillable\n      createable\n      updateable\n      filterable\n      sortable\n      idLookup\n      externalId\n      calculated\n      nameField\n    }\n    total\n    pageInfo {\n      hasNextPage\n      hasPreviousPage\n      startCursor\n      endCursor\n      prev\n    }\n  }\n}",
  "variables": {
    "projectReference": "string",
    "objectName": "string"
  }
}'
```

## Example response

```json
{
  "data": {
    "salesforceObjectFields": {
      "data": [
        {
          "name": "string",
          "label": "string",
          "type": "string",
          "referenceTo": [
            "string"
          ],
          "relationshipName": "string",
          "nillable": false,
          "createable": false,
          "updateable": false,
          "filterable": false,
          "sortable": false,
          "idLookup": false,
          "externalId": false,
          "calculated": false,
          "nameField": false
        }
      ],
      "total": 0,
      "pageInfo": {
        "hasNextPage": false,
        "hasPreviousPage": false,
        "startCursor": "string",
        "endCursor": "string",
        "prev": "string"
      }
    }
  }
}
```
