Skip to content

Calculate the query complexity based on how nested a field is (depth limitation) #96

Open
@kasir-barati

Description

@kasir-barati

So I was trying to see how other calculate their query complexity and ended up in the hygraph website, as you can see in their doc they are saying that how they calculate the query complexity is like this:

  • Scalar fields: Each scalar field in a query contributes one point to the query complexity.
  • Relations / Unions: Relations multiply their complexity times the level of nesting in the query.

Ref.

So I tried to find out how I can do it with this lib but it seems it is not possible with the current API. I also wanna point out that I feel like it is not completely impossible but I kinda have no clue as to how should I go about this: "multiply their complexity times the level of nesting in the query."

Any comment?

Side note: In NestJS we can see the same recommendation about scalar fields, i.e. to add one point to the overall complexity per scalar field (ref).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions