graphql-extended icon indicating copy to clipboard operation
graphql-extended copied to clipboard

incorrect complexity calculation?

Open chirag04 opened this issue 7 years ago • 0 comments

In the example, we have a cost of 0 for scalars and 1 for field. Docs says the complexity for below query is 6. Should it not be 2 in this case if scalars are 0 and field is 1 complex?

import { execute } from 'graphql-extended'
execute({
  schema: built,
  document: parse(`
    query GetUserAndPosts {
      user {
        id
        username
      }

      posts(limit: 20) {
        name
        age
      }
    }
  `),
  queryReducers: [ new ComplexityReducer() ],
})

chirag04 avatar Jun 17 '17 02:06 chirag04