Skip to content

Feature request #23

@blacksmoke26

Description

@blacksmoke26

According to Docs, Cost multiply by array's length:

N.B: if the parameter is an array, its multiplier value will be the length of the array (cf EG2).

Can we have this for Objects too? For example:

input PagerOptions {
	before: String
	after: String
	page: Int = 1
	limit: Int = 10
}

type Query {
  sections ( pager: PagerOptions = {} ):
    SectionsConnection @cost(multipliers: ["pager.limit", "pager"], complexity: {min: 3})
}

If we do so:

query GetSections {
  sections (pager: {
    limit: 50, # Count: 1
    page: 10, # Count: 2
  }) {
    nodes {
      id
      status
    }
  }
}

Then final counts should be:
50 + 2 (50: limit, 1+1: pager fields) = 52

What you say? Is it worthy?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions