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

When @link multiple subgraphs the @server port is overwritten from the last schema #2993

Open
2 tasks done
karatakis opened this issue Oct 11, 2024 · 1 comment
Open
2 tasks done

Comments

@karatakis
Copy link
Collaborator

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

When @link multiple subgraphs, the @server port from the main file is overwritten from the last schema.

Steps to reproduce

main.graphql

schema
  @link(type: Config, src: "./a.graphql")
  @link(type: Config, src: "./b.graphql")
  @server(port: 8080)
  @upstream {
  query: Query
}

type Query {
  main_version: Int! @expr(body: 1)
}

a.graphql

schema
  @server(port: 8081)
  @upstream {
  query: Query
}

type Query {
  a_version: Int! @expr(body: 1)
}

b.graphql

schema
  @server(port: 8082)
  @upstream {
  query: Query
}

type Query {
  b_version: Int! @expr(body: 1)
}

Expected behavior

The server should listen on port 8080

Actual behavior

The server listens at 8082

@ssddOnTop
Copy link
Member

it's because of our current merge_right implementation https://github.com/tailcallhq/tailcall/blob/a46a773f8a56fd2b9a22ec67dd4fd12d4415d266/src/core/merge_right.rs#L9C1-L19C1

we probably shouldn't directly implement merge right for Option<u16> as config::Server has pub port: Option<u16>

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

No branches or pull requests

2 participants