JDBC Driver for GraphQL

Build 25.0.9434

ExpandColumnsDepth

Specifies the depth at which the provider searches for columns within nested GraphQL objects, exposing those fields as columns.

Data Type

int

Default Value

2

Remarks

The ExpandColumnsDepth property controls how many levels of nested objects in your GraphQL schema are traversed and converted into individual SQL columns. This property directly affects the granularity of your relational schema, determining how much of the nested structure is flattened into separate columns.

Example Schema

For example, consider the following GraphQL schema:

type Query {
  company: Company
}

type Company {
  id: ID!
  details: Details
}

type Details {
  address: Address
  phoneNumber: String
}

type Address {
  city: String
  state: String
}

Nesting Levels

In this schema, the nesting levels are as follows:

Level 0: CompanyExposed by the root query.
Level 1: DetailsAn object within Company.
Level 2: AddressNested within Details.

  • If ExpandColumnsDepth is set to 0, the driver exposes the id field.
  • If ExpandColumnsDepth is set to 1, the driver exposes the phoneNumber field.
  • If ExpandColumnsDepth is set to 2 or higher, the driver also exposes the city and state fields.

For instance, a SQL query at depth 3 might look like:

SELECT id, details_address_city, details_address_state FROM company

Note: If a nested field returns a single object, that object is traversed and its fields surfaced as columns if the depth allows. If a nested field returns a list of objects, the driver aggregates the data into a JSON array.

Performance Considerations

Increasing the depth enables access to deeply nested fields, but may result in a more complex schema and increased processing time. A lower depth simplifies the schema and improves performance, but limits access to deeply nested data.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9434