Cycle API
CycleStatusChangelog
  • Cycle API
  • Introduction
    • About Cycle
    • Data model
  • The graphql API
    • How to start
    • Authentication
    • Node interface
    • Pagination
    • Webhooks
    • Limitations
    • Graphql Schema
    • Examples
  • Company
    • Company Attribute
    • List Company attributes by product
    • Create a company
    • Update a company attribute value
  • Practical use case: the feedback form
    • Create a feedback
    • Advanced: use your properties
Powered by GitBook
On this page
  • 1. Create a number company attribute
  • 2. Create a select company attribute
  • 3. Create a text attribute
  • 4. Create a boolean attribute
  • 5. Built in company attributes
  1. Company

Company Attribute

With the addNewCompanyAttribute mutation you can easily create a new attribute linked to your companies in your Cycle workspace. Attribute type can be a single select, a number, a text or a boolean

1. Create a number company attribute

mutation createScalarAttribute {
  addNewCompanyAttribute(
    input: {
      productId: "<productId>"
      name: "companyPropertyScalar"
      color: a
      type: { scalar: { type: NUMBER } }
    }
  ) {
    __typename
  }
}

2. Create a select company attribute

mutation createSingleSelectAttribute {
  addNewCompanyAttribute(
    input: {
      productId: "<productId>"
      name: "companyPropertySelect"
      color: a
      type: { select: { type: SINGLE_SELECT, values: ["a", "b"] } }
    }
  ) {
    __typename
  }
}

3. Create a text attribute

mutation scalarTextAttribute {
  addNewCompanyAttribute(
    input: {
      productId: "<productId>"
      name: "companyPropertyCheckBox"
      color: a
      type: { scalar: { type: TEXT } }
    }
  ) {
    __typename
  }
}

4. Create a boolean attribute

mutation scalarBooleanAttribute {
  addNewCompanyAttribute(
    input: {
      productId: "<productId>"
      name: "companyPropertyCheckBox"
      color: a
      type: { scalar: { type: BOOLEAN } }
    }
  ) {
    __typename
  }
}

5. Built in company attributes

In Cycle there are 2 builtin attributes which can be linked to a company.

type Company implements Node {
  id: ID!
  arr: Float
  numberOfEmployees: Int
  ...
}
PreviousLimitationsNextList Company attributes by product

Last updated 10 months ago