tailcallhq / tailcall

High Performance GraphQL Runtime
https://tailcall.run
Apache License 2.0
1.26k stars 237 forks source link

Bug: Extra input fields are not filtered out before send to the server #2513

Open karatakis opened 1 month ago

karatakis commented 1 month ago

Prerequisites

Describe the bug

When I specify an InputField and call the query with an extra input parameter Tailcall does not filter out the extra parameter and passes it over to the remote server.

Steps to reproduce

  1. Use the following GraphQL configuration
    
    schema @server(port: 8000) @upstream(baseURL: "http://localhost:8080") {
    query: Query
    }

type Query { foo(input: Bar): [Foo]! @http(method: POST, path: "/foo", body: "{{.args.input}}") }

input Bar { buzz: String! @modify(name: "fizz") }

type Foo { id: Int! alpha: String! beta: String! }

2. Run the following command `nc -l 8080`
3. Query the API
```graphql
query {
  foo (input: {fizz: "test", kazz: "tost" }) {
    id
  }
}
  1. See that the requested body is
    
    POST /foo HTTP/1.1
    content-type: application/json
    accept: */*
    user-agent: Tailcall/1.0
    host: localhost:8080
    content-length: 29

{"fizz":"test","kazz":"tost"}



### Expected behavior

The `kazz` variable should be filtered out

### Actual behavior

The `jazz` variable is passed to the server without implicitly allowing Tailcall to do it.

### Environment information:

- **Operating System**: Linux Mint 21
- **Tailcall Version**: v0.1-dev
- **Rust Version**: 1.79
- **GraphQL Client/version**: webui
karatakis commented 1 month ago

I spotted the bug while working on https://github.com/tailcallhq/tailcall/issues/2483. I will close the issue when I make a PR for the other issue.

github-actions[bot] commented 1 week ago

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

github-actions[bot] commented 22 hours ago

Issue closed after 7 days of inactivity.