tailcall
tailcall copied to clipboard
bug(grpc): validation errors have incorrect traces
GRPC validation displays errors in a non-standard format. For eg:
Tailcall Config
# for test upstream server see [repo](https://github.com/tailcallhq/rust-grpc)
schema
@server(port: 8000, graphiql: true)
@upstream(baseURL: "http://localhost:50051", httpCache: true, batch: {delay: 10})
@link(id: "news", src: "../src/grpc/tests/proto/news.proto", type: Protobuf) {
query: Query
}
type Query {
news: NewsData! @grpc(method: "news.NewsService.GetAllNews")
newsById(news: NewsInput!): News! @grpc(method: "news.NewsService.GetNews", body: "{{args.news}}")
newsByIdBatch(news: NewsInput!): News!
@grpc(method: "news.NewsService.GetMultipleNews", body: "{{args.news}}", batchKey: ["news", "id"])
}
type News {
id: Int
title: String
body: String
# Ignoring this field for now
# postImage: String
}
input NewsInput {
id: Int
}
type NewsData {
news: [News]!
}
Proto File
syntax = "proto3";
import "google/protobuf/empty.proto";
package news;
message News {
int32 id = 1;
string title = 2;
string body = 3;
string post_image = 4;
}
service NewsService {
rpc GetAllNews (google.protobuf.Empty) returns (NewsList) {}
rpc GetNews (NewsId) returns (News) {}
rpc GetMultipleNews (MultipleNewsId) returns (NewsList) {}
rpc DeleteNews (NewsId) returns (google.protobuf.Empty) {}
rpc EditNews (News) returns (News) {}
rpc AddNews (News) returns (News) {}
}
message NewsId {
int32 id = 1;
}
message MultipleNewsId {
repeated NewsId ids = 1;
}
message NewsList {
repeated News news = 1;
}
Actual Error
INFO File read: ./examples/grpc.graphql ... ok
INFO File read: ./examples/../src/grpc/tests/proto/news.proto ... ok
INFO File read: ./examples/../src/grpc/tests/proto/news.proto ... ok
INFO N + 1 detected: 0
ERROR Invalid Configuration
Caused by:
• missing key: postImage [at [email protected]]
• missing key: postImage [at [email protected]]
• missing key: postImage [at [email protected]]
Expected Error
INFO File read: ./examples/grpc.graphql ... ok
INFO File read: ./examples/../src/grpc/tests/proto/news.proto ... ok
INFO File read: ./examples/../src/grpc/tests/proto/news.proto ... ok
INFO N + 1 detected: 0
ERROR Invalid Configuration
Caused by:
• missing key: postImage [at News]
Technical Requirements
- Fix the error write an execution spec for it.
/bounty 100$
~~## 💎 $100 bounty • Tailcall Inc.~~
~~### Steps to solve:~~
~~1. Start working: Comment /attempt #1546 with your implementation plan~~
~~2. Submit work: Create a pull request including /claim #1546 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.~~
| Attempt | Started (GMT+0) | Solution |
|---|---|---|
| 🔴 @webbdays | Mar 23, 2024, 7:15:52 AM | WIP |
| 🔴 @ssddOnTop | Mar 26, 2024, 3:26:25 PM | #1568 |
droping.
@ssddOnTop,
/attempt
| Algora profile | Completed bounties | Tech | Active attempts | Options |
|---|---|---|---|---|
| @ssddOnTop | 28 tailcallhq bounties | Rust, Java, C & more |
tailcallhq/tailcall#1285 |
Cancel attempt |
This issue is not top priority for me as of now. I’ll start working in a few days so between that if anyone else raises a PR then I’ll back off.
#1554
💡 @ssddOnTop submitted a pull request that claims the bounty. You can visit your bounty board to reward.
some work (probably valuable) have been done in https://github.com/tailcallhq/tailcall/pull/1568 those who wants to attempt, feel free to use code from the PR.
I have also commented some TODOs in the PR only those needs to be fixed imo.
@tusharmath the solution should affect all the other traces or only the grpc mentioned on the issue's description?
Action required: Issue inactive for 30 days. Status update or closure in 7 days.
Issue closed after 7 days of inactivity.