Skip to content

tc check incorrectly identifies n + 1 #342

@sujeetsr

Description

@sujeetsr

Description

tc check -n includes query and relationships that are not lists in N+1 information

Steps to reproduce

Create a jsonplaceholder.graphql config

schema
  @server(
    baseURL: "http://jsonplaceholder.typicode.com"
    enableGraphiql: "/graphiql"
  ) {
  query: Query
}

type User {
  id: ID!
  name: String
  comments: [Comment] @http(path: "/users/{{value.id}}/comments")
}

type Comment {
  id: ID!
  body: String
}

type Query {
  user(id: ID!): User @http(path: "/users/{{args.id}}")
}

Run the following command

cargo run -- check -n  ./jsonplaceholder.graphql

Expected behavior

No errors found
N + 1: 0

Actual behaviour

Incorrectly identifies the query as a n + 1 query.

No errors found
N + 1: 1
  query { user { comments } }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions