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

bug: query plan fails resolve dependencies #3013

Open
laststylebender14 opened this issue Oct 15, 2024 · 1 comment
Open

bug: query plan fails resolve dependencies #3013

laststylebender14 opened this issue Oct 15, 2024 · 1 comment
Labels
type: bug Something isn't working.

Comments

@laststylebender14
Copy link
Contributor

for example for following schema, user field is dependent on the userId field.

schema
  @server(port: 8000)
  @upstream(baseURL: "http://jsonplaceholder.typicode.com", httpCache: 42, batch: {delay: 100}) {
  query: Query
}

type Query {
  posts: [Post] @http(path: "/posts")
}

type User {
  id: Int!
  name: String!
}

type Post {
  id: Int!
  title: String!
  userId: Int @http(path: "/users/1", select: "{{.id}}")
  user: User @http(path: "/users", query: [{key: "id", value: "{{.value.userId}}"}], batchKey: ["id"])
}

logs:

 INFO File read: ./examples/jsonplaceholder.graphql ... ok
 INFO N + 1 detected: 1
 INFO 🚀 Tailcall launched at [127.0.0.1:8000] over HTTP/1.1
 INFO 🌍 Playground: https://tailcall.run/playground/?u=http://127.0.0.1:8000/graphql&utm_source=tailcall-debug&utm_medium=server
 INFO GET http://jsonplaceholder.typicode.com/posts HTTP/1.1
 INFO GET http://jsonplaceholder.typicode.com/users/1 HTTP/1.1
 INFO GET http://jsonplaceholder.typicode.com/users?id HTTP/1.1

Query Plan should be able to figure out which operations are dependent and which are independent. Independent operations can be executed in parallel manner.

@tusharmath tusharmath added the type: bug Something isn't working. label Oct 21, 2024
@tusharmath
Copy link
Contributor

Let's throw a validation error for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

2 participants