tailcallhq / tailcall

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

Add `Pos` to `Config` #1698

Closed tusharmath closed 2 weeks ago

tusharmath commented 4 months ago

Currently Config type doesn't hold any position information in its fields. This makes it extremely difficult to debug and attach meaningful traces. In this issue, we want to insert tracing information in the config. That way we could see better errors:

Current

❯ tailcall check ./examples/jsonplaceholder.graphql
 INFO Env file: "/Users/tushar/Documents/Projects/tailcall/.env" loaded
 INFO File read: ./examples/jsonplaceholder.graphql ... ok
 WARN A new release of tailcall is available: v0.74.1 ➜ v0.74.12
 WARN To upgrade, run: brew upgrade tailcall
 WARN https://github.com/tailcallhq/tailcall/releases/tag/v0.74.12
ERROR Invalid Configuration
Caused by:
  • No base URL defined [at Post.user.@call.@http]
  • No base URL defined [at Query.posts.@http]
  • No base URL defined [at Query.user.@http]
  • No base URL defined [at Query.users.@http]

Expected

❯ tailcall check ./examples/jsonplaceholder.graphql
 INFO Env file: "/Users/tushar/Documents/Projects/tailcall/.env" loaded
 INFO File read: ./examples/jsonplaceholder.graphql ... ok
 WARN A new release of tailcall is available: v0.74.1 ➜ v0.74.12
 WARN To upgrade, run: brew upgrade tailcall
 WARN https://github.com/tailcallhq/tailcall/releases/tag/v0.74.12
ERROR Invalid Configuration
Caused by:
  • No base URL defined [at ./examples/jsonplaceholder.graphql#8:17]

Going forward we would be able to extract a piece of text from the source file and display it on the CLI with swiggly lines under it.

Technical Requirements

tusharmath commented 4 months ago

/bounty 100$

algora-pbc[bot] commented 4 months ago

## 💎 $100 bounty • Tailcall Inc.

### Steps to solve: 1. Start working: Comment /attempt #1698 with your implementation plan 2. Submit work: Create a pull request including /claim #1698 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. 💵 More about our bounty program.

Attempt Started (GMT+0) Solution
🔴 @timburrows Apr 13, 2024, 3:32:38 AM WIP
🔴 @emekaokoli19 Apr 20, 2024, 3:06:55 AM WIP
timburrows commented 4 months ago

/attempt #1698

algora-pbc[bot] commented 4 months ago

@timburrows: Reminder that in 1 days the bounty will become up for grabs, so please submit a pull request before then 🙏

algora-pbc[bot] commented 4 months ago

The bounty is up for grabs! Everyone is welcome to /attempt #1698 🙌

timburrows commented 4 months ago

I'm still looking into this but I haven't determined a good way to maintain Pos data on each of the fields without a lot of otherwise unused members on each struct. I was considering that if the only use case was for tracing, keeping a key value pair might suffice?

emekaokoli19 commented 4 months ago

/attempt #1698

github-actions[bot] commented 3 months ago

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

github-actions[bot] commented 2 months ago

Issue closed after 7 days of inactivity.

github-actions[bot] commented 3 weeks ago

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

github-actions[bot] commented 2 weeks ago

Issue closed after 7 days of inactivity.