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 in the nested queries when working with @graphql #3088

Closed
2 tasks done
MedHeikelBouzayene opened this issue Oct 30, 2024 · 4 comments · Fixed by #3106
Closed
2 tasks done

Bug in the nested queries when working with @graphql #3088

MedHeikelBouzayene opened this issue Oct 30, 2024 · 4 comments · Fixed by #3106
Labels
type: bug Something isn't working.

Comments

@MedHeikelBouzayene
Copy link
Contributor

MedHeikelBouzayene commented Oct 30, 2024

Prerequisites

  • I have checked the existing issues to ensure this is not a duplicate.
  • I am running the latest version of Tailcall.

Describe the bug

Let's have this schema:

schema @server(port: 8000, hostname: "0.0.0.0") {
  query: Query
}

type Query {
  queryNodeA: NodeA @graphQL(url: "http://localhost:8083", name: "nodeA")
}

type NodeA {
  name: String
  nodeB: NodeB
  nodeC: NodeC
}

type NodeB {
  name: String
  nodeA: NodeA
  nodeC: NodeC
}

type NodeC {
  name: String
  nodeA: NodeA
  nodeB: NodeB
}

when I send try this query:

query QueryNodeA {
    queryNodeA {
        name
        nodeB {
            name
        }
        nodeC {
            name
        }
    }
}

that's the query sent to the graphql server: > Body
{ "query": "query { nodeA { name nodeB { name } nodeC } }" }

Expected behavior

That's the query expected to be sent to the graphql server:

Body

{ "query": "query { nodeA { name nodeB { name } nodeC { name } } }" }

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

This can be fixed by adding a jit/transform/graphql.rs. This transformer will be responsible to building the exact GraphQL query for each source GraphQL query.

Copy link

github-actions bot commented Dec 2, 2024

Action required: Issue inactive for 30 days.
Status update or closure in 7 days.

@github-actions github-actions bot added the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Dec 2, 2024
@laststylebender14
Copy link
Contributor

@MedHeikelBouzayene Can you try this PR and see if it resolves your use case?

@github-actions github-actions bot removed the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Dec 9, 2024
@MedHeikelBouzayene
Copy link
Contributor Author

Yes it does resolve it, thank you

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
3 participants