Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request #23

Open
blacksmoke26 opened this issue Feb 27, 2019 · 0 comments
Open

Feature request #23

blacksmoke26 opened this issue Feb 27, 2019 · 0 comments

Comments

@blacksmoke26
Copy link

blacksmoke26 commented Feb 27, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant