LogoLogo
  • Introduction
  • Overview
    • API request limits
    • Errors
    • Other references
  • Getting started
    • 🆕What's new in v4?
    • Transitioning from v3 to v4
  • 🔑Authentication
    • Requesting temporary credentials
    • Signing requests
    • User permissions
  • 🎬Entities
    • Char types
    • The entity object
    • Amount
      • Create an amount
      • Retrieve an amount
      • Update an amount
      • Delete an amount
      • Retrieve amount statuses
      • Retrieve amount workflow processes
      • Retrieve amount draft templates
      • Retrieve amount audit history
      • Switch amount template
      • Retrieve amount validation errors
    • Catalog item
      • Create a catalog item
      • Retrieve a catalog item
      • Update a catalog item
      • Delete a catalog item
      • Retrieve catalog item template list
      • Retrieve catalog item statuses
      • Retrieve catalog item workflow processes
      • Retrieve catalog item draft templates
      • Retrieve catalog item key art URL
      • Upload/update catalog item key art
      • Delete catalog item key art
      • Retrieve catalog item audit history
      • Switch catalog item template
      • Retrieve catalog item validation errors
      • Retrieve all rights in catalog hierarchy
      • Catalog item delete check
      • Retrieve catalog item worksheets
      • Overwrite catalog item parties
    • Contact
      • Create a contact
      • Retrieve a contact
      • Update a contact
      • Delete a contact
      • Retrieve contact statuses
      • Retrieve contact workflow processes
      • Retrieve contact draft templates
      • Retrieve contact audit history
      • Switch contact template
      • Contact delete check
      • Retrieve contact validation errors
    • Deal
      • Create a deal
      • Retrieve a deal
      • Update a deal
      • Delete a deal
      • Retrieve deal statuses
      • Retrieve deal workflow processes
      • Retrieve deal draft templates
      • Retrieve deal audit history
      • Switch deal template
      • Retrieve deal validation errors
      • Retrieve deal conflicts
      • Override deal conflict
      • Overwrite deal parties
    • File
      • Create a file
      • Retrieve a file
      • Retrieve File Version
      • Retrieve File Revisions
      • Retrieve file data
      • Retrieve File Version URL
      • Retrieve File Version Data
      • Delete a file
      • Retrieve file statuses
      • Retrieve file workflow processes
      • Retrieve file draft templates
      • Retrieve file validation errors
      • Grant Access To File
      • Revoke Access From File
    • Financial document
      • Create a financial document
      • Retrieve a financial document
      • Update a financial document
      • Delete a financial document
      • Retrieve financial document statuses
      • Retrieve financial document workflow processes
      • Retrieve financial document draft templates
      • Retrieve financial document audit history
      • Switch financial document template
      • Retrieve financial document validation errors
      • Overwrite financial document parties
    • Inventory
      • Create an inventory item
      • Retrieve an inventory item
      • Update an inventory item
      • Delete an inventory item
      • Retrieve inventory statuses
      • Retrieve inventory workflow processes
      • Retrieve inventory draft templates
      • Retrieve an inventory key art URL
      • Update an inventory key art
      • Delete an inventory key art
      • Retrieve inventory audit history
      • Switch inventory template
      • Retrieve inventory validation errors
      • Overwrite inventory parties
    • Project
      • Create a project
      • Retrieve a project
      • Update a project
      • Delete a project
      • Retrieve project statuses
      • Retrieve project workflow processes
      • Retrieve project draft templates
      • Retrieve project audit history
      • Switch project template
      • Retrieve project validation errors
      • Overwrite project parties
    • Job
      • Create a job
      • Retrieve a job
      • Update a job
      • Delete a job
      • Retrieve job statuses
      • Retrieve job workflow processes
      • Retrieve job draft templates
      • Retrieve job audit history
      • Switch job template
      • Retrieve job validation errors
      • Overwrite job parties
    • Right
      • Create a right
      • Retrieve a right
      • Update a right
      • Delete a right
      • Retrieve right statuses
      • Retrieve right workflow processes
      • Retrieve right draft templates
      • Retrieve relative rights profiles
      • Execute relative rights profile
      • Retrieve right audit history
      • Switch right template
      • Retrieve right validation errors
    • Table
      • Create a table row
      • Retrieve a table row
      • Update a table row
      • Delete a table row
      • Retrieve table statuses
      • Retrieve table workflow processes
      • Retrieve table draft templates
      • Retrieve table audit history
      • Switch table template
      • Retrieve table validation errors
  • 👬Relationships
    • The relationship object
    • Relationship types
    • Create a relationship
    • Delete a relationship
    • Create a party relationship
  • 🔎Search
    • Entity search
    • Relationship search
    • Pagination
      • Making paginated search requests
      • Sorting search responses
    • Search fields
    • Search functions
      • Single query functions
      • Multi-query functions
        • $and
        • $or
        • $not
      • Join functions
        • $join_parent_rel
        • $join_child_rel
        • $join
    • Searching for deleted entities or relationships
    • Examples
      • Find financial document by parent financial document
      • Search by template and status
      • Find catalog items on a deal
      • Find rights on catalog item
      • Find rights by child contact
      • Search for all records that don't have a value for a specific field
      • Search relationships, filtering by template of child record
  • 📦Batch
    • Overview
      • Limitations
      • Batch structure
      • Batch methods
      • Batch options
      • Batch statuses
      • Error handling
    • Create a batch
    • Retrieve a batch
  • 📊GRAPHQL
    • Overview
    • Entity
      • Parents
      • Children
      • Characteristics
      • Parties
      • DateMath
    • Errors
  • 🎯Data Defaults (Profiles)
    • Data default, aka Profiles
    • Create a data default
    • Retrieve data defaults
    • Apply data default
    • Delete data default
  • 🧰Workflow
    • Execute a workflow action
    • Execute document workflow action
    • Execute a workflow action with signature
    • Get workflow actions
    • Get workflow action details
    • Get workflow statuses
    • Get workflow notifications
  • 💲FINANCIAL
    • Create a royalty
      • Create a royalty set
      • Associate royalty set to deal
      • Associate royalty set to catalog
      • Create royalty split
      • Associate royalty split to royalty set
      • Associate contact to royalty split
    • Get amortization models
    • Calculate amortization
    • Get allocation models
    • Calculate allocations
    • Financial periods
      • Create financial period
      • Get financial periods
      • Get financial periods settings
      • Update financial period
      • Update financial period settings
      • Close financial period
      • Delete financial period
  • 📐Configuration
    • Lists
      • Retrieve master value list
      • Add value to master list
      • Update value in master list
      • Remove value from master list
      • Retrieve pick list
      • Retrieve pick list presets
      • Add values to pick list
      • Remove value from pick list
    • Currency conversion
      • Create a currency conversion
      • Retrieve a currency conversion
      • Retrieve all currency conversions
      • Update a currency conversion
      • Delete a currency conversion
    • Data types
      • Alphanumeric text
        • Free text
        • List of Values (LOVs)
      • Checkbox
        • Yes only
      • Date
      • Email
      • External Document
      • Four Digit Year
      • Internet Address
      • Money
      • Number
        • Percentage
      • SMPTETimeCode
      • Others
    • Templates
    • Fields
  • 📆Date Math
    • Overview
    • The date math object
    • Create date math
    • Retrieve date math
    • Update date math
    • Delete date math
  • ❗Alerts
    • Date alerts
      • Retrieve date alerts
  • 🧮AVAILS
    • Overview
    • Get dimension data
    • Get reason unavailable list
    • Get availability
      • Availability request vs Rights Explorer
    • Get unavailable reasons
    • Get available catalog items
    • Is catalog item available
    • Catalog last calculated
    • Get Snapshots
    • Get Snapshot Details
    • Delete Snapshot
  • 🧑Users
    • Get applications
    • Get roles
    • Get user
    • Create a user
    • Update user messaging
    • Apply user applications
    • Apply user roles
    • Delete user
    • Get user identity role
    • Get user activity policy
  • ⌨️Single sign-on
    • Overview
    • Retrieve SSO configuration
    • Update SSO configuration
    • Delete SSO configuration
  • 📦Starter Packs
    • Catalog metadata
    • Availability feed
  • Swagger
  • Postman
  • Message queue docs
  • Rightsline.com
Powered by GitBook
On this page
  • Aliasing
  • Paging
  • Filtering
  • String Filtering
  • Comparable Filtering
  • and / or Filtering
  • Sorting

Was this helpful?

  1. GRAPHQL
  2. Entity

Parents

PreviousEntityNextChildren

Last updated 1 year ago

Was this helpful?

GraphQL can significantly enhance the power of your API Integration. To onboard, please reach out to your Account Manager for pricing information.

Parents is a field on the root type that represents the entity's associated parent records. Parents is an array of type Entity, and is specified by passing a char type ID parameter.

{
    entity(id: 10, charTypeId: 3) {
       parents(charTypeId: 4) {
            items {
                 id
                 title
                 template {
                      templateId
                 }
            }
       }   
    }
}

The Parents field is especially powerful because it allows you to traverse a record's hierarchy. You can include multiple Parents fields for each entity to represent different char types, and each Parent Entity can have its own Parents field. Chaining together the Parents fields allows you to traverse an entire record's hierarchy in a single request.

In the example below, we are retrieving a Rights record, it's parent Catalog records, and those Catalog's parent Deal records.

{
    entity(id: 10, charTypeId: 3) {
       parents(charTypeId: 1) {
            items {
                 id
                 title
                 template {
                      templateId
                 }
                 parents(charTypeId: 4) {
                      items {
                           id
                           title
                           template {
                                templateId
                           }
                      }
                 }
            }
       }    
    }
}

Response:

{
    "data": {
        "entity": {
            "parents": {
                "items": [
                    {
                        "id": 100,
                        "title": "Catalog 1",
                        "template": {
                            "templateId": 1
                        }
                        "parents": {
                            "items": [
                                {
                                    "id": 400,
                                    "title": "Deal 1",
                                    "template": {
                                        "templateId": 1
                                    }
                                },
                                {
                                    "id": 401,
                                    "title": "Deal2",
                                    "template": {
                                        "templateId": 2
                                    }
                                }
                            ]
                        }
                    },
                    {
                        "id": 101,
                        "title": "Catalog 2",
                        "template": {
                            "templateId": 2
                        }
                        "parents": {
                            "items": []
                        }
                    }
                ]
            }
        }
    }
}

Aliasing

When using multiple Parents fields for different char types, it is necessary to keep track of what a certain Parents field represents by using an Alias. Adding an alias to a field will rename the response Parents field with the desired alias name.

In the below example, catalog is added as an alias for parent records with char type ID = 1 and deals is added an alias for parent records with a char type ID = 4.

{
    entity(id: 10, charTypeId: 3) {
       catalog: parents(charTypeId: 1) {
            items {
                 id
                 title
                 template {
                      templateId
                 }
            }
       } 
       deals: parents(charTypeId: 4) {
            items {
                 id
                 title
                 template {
                      templateId
                 }
            }
       }    
    }
}

Response:

{
    "data": {
        "entity": {
            "id": 10,
            "title": "Right 1",
            "template": {
                "templateId": 1
            },
            : {
                "items": [
                    {
                        "id": 100,
                        "template": {
                            "templateId": 1
                        },
                        "title": "Catalog 1"
                    },
                    {
                        "id": 101,
                        "template": {
                            "templateId": 2
                        },
                        "title": "Catalog 2"
                    }
                ]
            },
            : {
                "items": [
                    {
                        "id": 200,
                        "template": {
                            "templateId": 1
                        },
                        "title": "Deal 1"
                    },
                    {
                        "id": 201,
                        "template": {
                            "templateId": 2
                        },
                        "title": "Deal 2"
                    }
                ]
            }
        }
    }
}

Paging

To limit response sizes, the Parents field utilizes paging. To page through the children records, use the skip and take parameters:

{
    entity(id: 10, charTypeId: 3) {
       deals: parents(charTypeId: 4, : 10, : 10) {
            items {
                 id
                 title
                 template {
                      templateId
                 }
            }
       }  
    }
}

The default page size is 50.

There are also additional fields in the request that help to identify the total number of Parents records (totalCount), if a previous page exists (hasPreviousPage), and if a next page exists (hasNextPage). hasPreviousPage and hasNextPage are nested in a pageInfo object on the Parents object:

{
    entity(id: 10, charTypeId: 3) {
       deals: parents(charTypeId: 4, skip: 10, take: 2) {
            
            pageInfo {
                 hasPreviousPage
                 hasNextPage
            }
            items {
                 id
                 title
                 template {
                      templateId
                 }
            }
       }  
    }
}

Response:

{
    "data": {
        "entity": {
            "id": 10,
            "title": "Right 1",
            "template": {
                "templateId": 1
            },
            "deals": {
                "totalCount": 24,
                "pageInfo": {
                    "hasPreviousPage": true,
                    "hasNextPage": true
                },
                "items": [
                    {
                        "id": 100,
                        "template": {
                            "templateId": 1
                        },
                        "title": "Deal 1"
                    },
                    {
                        "id": 101,
                        "template": {
                            "templateId": 2
                        },
                        "title": "Deal 2"
                    }
                ]
            }
        }
    }
}

Using these fields and parameters, you can page through the Parents in subsequent requests, using logic similar to:

if (pageInfo.hasNextPage)

skip = skip + take

Filtering

Parents can be filtered by using a special parameter object called where.

{
    entity(id: 10, charTypeId: 1) {
       parents(charTypeId: 4, where: {templateId: {eq: 1}}) {
            items {
                 id
                 title
                 template {
                      templateId
                 }
            }
       }  
    }
}

All of the following Entity fields can be filtered on in the Parents collection:

  • title

  • templateId

  • statusId

  • createdBy

  • createdDate

  • lastUpdatedBy

  • lastUpdatedDate

  • statusUpdatedBy

  • statusUpdatedDate

String Filtering

String fields (title) can be filtered using the following operators:

operator
value type
description
usage

eq

String

exact match

{title: {eq: "Episode 1"}}

neq

String

doesn't match

{title: {neq: "Episode 1"}}

contains

String

substring match

{title: {contains: "Episode"}}

ncontains

String

doesn't contain substring match

{title: {ncontains: "Episode"}}

in

[String]

exact match one of the following

{title: {in: ["Episode 1", "Episode 2"]}}

nin

[String]

doesn't match any of the following

{title: {nin: ["Episode 1", "Episode 2"]}}

startsWith

String

string starts with

{title: {startsWith: "Episode"}}

nstartsWith

String

string doesn't start with

{title: {nstartsWith: "Episode"}}

endsWith

String

string ends with

{title: {endsWith: "Episode"}}

nendsWith

String

string doesn't end with

{title: {nendsWith: "Episode"}}

Comparable Filtering

Field types of bool, int, and DateTime such as templateId, statusId, createdBy, createdDate, lastUpdatedBy, lastUpdatedDate, statusUpdatedBy, statusUpdatedDate can be filtered using the following operators:

operator
value type
description
usage

eq

Int, Bool, DateTime

exact match

{templateId: {eq: 1}}

neq

Int, Bool, DateTime

doesn't match

{templateId: {eq: 1}}

in

[Int], [Bool], [DateTime]

matches one of the following

{templateId: {in: [1,2]}}

nin

[Int], [Bool], [DateTime]

doesn't match any of the following

{statusId: {nin: [1,2,3]}}

gt

Int, Bool, DateTime

greater than

{createdDate: {gt:

"2023-06-27T16:07:08.570Z"}}

ngt

Int, Bool, DateTime

not greater than

{createdDate: {gt:

"2023-06-27T16:07:08.570Z"}}

gte

Int, Bool, DateTime

greater than or equal

{createdDate: {gte:

"2023-06-27T16:07:08.570Z"}}

ngte

Int, Bool, DateTime

not greater than or equal

{createdDate: {ngte:

"2023-06-27T16:07:08.570Z"}}

lt

Int, Bool, DateTime

less than

{createdDate: {lt:

"2023-06-27T16:07:08.570Z"}}

nlt

Int, Bool, DateTime

not less than

{createdDate: {nlt:

"2023-06-27T16:07:08.570Z"}}

lte

Int, Bool, DateTime

less than or equal

{createdDate: {lte:

"2023-06-27T16:07:08.570Z"}}

nlte

Int, Bool, DateTime

not less than or equal

{createdDate: {nlte:

"2023-06-27T16:07:08.570Z"}}

and / or Filtering

All of the above operators can be combined using the and and or operators:

operator
description
usage

and

all conditions must be true

{ and: [ {lastUpdatedDate: {gt: "2023-06-27T16:07:08.570Z"}}, {templateId: {in: [1,2]}} ] }

or

one condition must be true

{ or: [ {lastUpdatedDate: {gt: "2023-06-27T16:07:08.570Z"}}, {templateId: {in: [1,2]}} ] }

Sorting

To sort the records in the response by a specific field, specify an order parameter:

{
    entity(id: 10, charTypeId: 1) {
       deals: parents(charTypeId: 4, order: [{ lastUpdatedDate: DESC }]) {
            items {
                 id
                 title
                 template {
                      templateId
                 }
            }
       }  
    }
}

You can sort by the following fields:

  • id

  • title

  • createdBy

  • createdDate

  • lastUpdatedBy

  • lastUpdatedDate

  • statusUpdatedBy

  • statusUpdatedDate

You can sort each of the fields above either ascending using ASC or descending using DESC.

You can also sort on a field and then by another field:

{
    entity(id: 10, charTypeId: 1) {
       deals: parents(charTypeId: 4, order: [{ lastUpdatedDate: DESC }, { id: ASC }]) {
            items {
                 id
                 title
                 template {
                      templateId
                 }
            }
       }  
    }
}
📊
Entity