Skip to content

bug: Invalid N + 1 detection #3161

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

Closed
tusharmath opened this issue Nov 26, 2024 · 3 comments
Closed

bug: Invalid N + 1 detection #3161

tusharmath opened this issue Nov 26, 2024 · 3 comments

Comments

@tusharmath
Copy link
Contributor

Running tailcall check produces duplicate N + 1 checks:

tailcall --version; tailcall check -n ./main.graphql
tailcall v0.129.1
 INFO File read: ./.tailcallrc.graphql ... ok
 INFO File read: ./main.graphql ... ok
 INFO Config ./main.graphql ... ok
 INFO N + 1 detected: 2
query { posts { user { posts } } }
query { posts { user { posts } } }
schema @server @upstream(batch: { delay: 1 }) {
  query: Query
}

type Query {
  users: [User] @http(url: "https://jsonplaceholder.typicode.com/users")
  posts: [Post] @http(url: "https://jsonplaceholder.typicode.com/posts")
}

type User {
  id: ID!
  name: String!
  posts: [Post]
    @http(
      url: "https://jsonplaceholder.typicode.com/posts?userId={{.value.id}}"
    )
}

type Post {
  id: ID!
  title: String!
  userId: ID!
  user: User
    @http(
      url: "https://jsonplaceholder.typicode.com/users"
      query: [{ key: "id", value: "{{.value.userId}}" }]
      batchKey: ["id"]
      dedupe: true
    )
}
@tusharmath
Copy link
Contributor Author

/bounty $200

Copy link

algora-pbc bot commented Nov 26, 2024

💎 $200 bounty • Tailcall Inc.

Steps to solve:

  1. Start working: Comment /attempt #3161 with your implementation plan
  2. Submit work: Create a pull request including /claim #3161 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

🙏 Thank you for contributing to tailcallhq/tailcall!
🧐 Checkout our guidelines before you get started.
💵 More about our bounty program.

Attempt Started (GMT+0) Solution
🟢 @dekkku #3166

@meskill
Copy link
Contributor

meskill commented Nov 28, 2024

this is already fixed by #2978

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

Successfully merging a pull request may close this issue.

2 participants