Skip to content

depth validation bug #1052

Open
Open
@jBosak98

Description

@jBosak98

Hello, I'm trying to validate a query using wundergraph tools. I have a problem with the depth validation.

The Operation I have is as follows:

query ProductDetails {
  product {
    __typename
    id
    __typename
    externalId
    features { 
      __typename
      feature {
        __typename
        id
      }
      ... on LookupProductCharacteristicValue { 
        __typename
        value {
          __typename
          ... on CustomFeatureRecord {
            __typename
            customFeature {
              __typename 
              key
            }
            id
            name
          }
        }
      }
    }
  }
}

The operation depth for the above query is 8.

When I remove the feature, the query will look like this:

query ProductDetails {
  product {
    __typename
    id
    __typename
    externalId
    features { 
      __typename
      ... on LookupProductCharacteristicValue { 
        __typename
        value {
          __typename
          ... on CustomFeatureRecord {
            __typename
            customFeature {
              __typename 
              key
            }
            id
            name
          }
        }
      }
    }
  }
}

The operation depth for the above query is 9.

So, I removed the feature object with some fields, and the query depth is bigger. The same happens when I move the feature at the end of the scope, for example, the query that is below also has depth 9:

query ProductDetails {
  product {
    __typename
    id
    __typename
    externalId
    features { 
      __typename
      ... on LookupProductCharacteristicValue { 
        __typename
        value {
          __typename
          ... on CustomFeatureRecord {
            __typename
            customFeature {
              __typename 
              key
            }
            id
            name
          }
        }
      }
      feature {
        __typename
        id
      }
    }
  }
}

As far as I understand, the selectionSetDepth value is polluted, but only if there is an object with some fields before the spread (...).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions