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

Federation Subgraph: add validation for used fields #2911

Open
meskill opened this issue Sep 25, 2024 · 2 comments
Open

Federation Subgraph: add validation for used fields #2911

meskill opened this issue Sep 25, 2024 · 2 comments

Comments

@meskill
Copy link
Contributor

meskill commented Sep 25, 2024

Resolvers on types could use different fields from the respective type inside the resolver itself.

Add a validation that every field that is used as .value.field_name inside the resolver is actually part of the type and if not generated a Validation error with info about unknown field. Make sure nested paths .value.a.b.c are covered as well.

Good Example

type User @http(path: "/users/{{.value.id}}") {
  id: ID
  name: String
}

Bad Examples

type User @http(path: "/users/{{.value.foo.id}}") {
  id: ID
  name: String
}
type User @http(path: "/users/{{.value.age}}") {
  id: ID
  name: String
}
@tusharmath
Copy link
Contributor

/bounty $50

Copy link

algora-pbc bot commented Sep 25, 2024

💎 $50 bounty • Tailcall Inc.

Steps to solve:

  1. Start working: Comment /attempt #2911 with your implementation plan
  2. Submit work: Create a pull request including /claim #2911 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
🟢 @dekkku #2916

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

Successfully merging a pull request may close this issue.

2 participants