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

Write a guide about using JS to perform data transformation #152

Closed
tusharmath opened this issue Mar 13, 2024 · 5 comments
Closed

Write a guide about using JS to perform data transformation #152

tusharmath opened this issue Mar 13, 2024 · 5 comments

Comments

@tusharmath
Copy link
Contributor

Update the http-filters.md with an example of modifying incoming request data.

schema  {
  query: Query
  mutation: Mutation
}

type Mutation {
  createUser(input: InputUser): UserCreated @http(
    method: POST, 
    path: "/users", 
    query: [{key: "user", value: "{{args.input}}"}] # pass input as an argument
}

input InputUser {
  name: String
  age: Int
}
function onRequest({request}) {
   const user = JSON.parse(decodeURIComponent(request.uri.query.user))
   request.uri.query = {}
   request.body = {
      userName: user.name,
      userAge: user.age
   }
   return {request}
}

Something on the above lines.

IMPORTANT: Make sure you try the final configuration and that it works.

@tusharmath
Copy link
Contributor Author

/bounty 50$

Copy link

algora-pbc bot commented Mar 13, 2024

💎 $50 bounty created by tailcallhq
🙋 If you start working on this, comment /attempt #152 along with your implementation plan
👉 To claim this bounty, submit a pull request that includes the text /claim #152 somewhere in its body

🙏 Thank you for contributing to tailcallhq/tailcallhq.github.io!.
🧐 Checkout our guidelines before you get started.

Attempt Started (GMT+0) Solution
🟢 @neo773 Mar 13, 2024, 7:23:53 AM WIP
🟢 @guptadeepak8 #156

@neo773
Copy link
Contributor

neo773 commented Mar 13, 2024

/attempt #152

Algora profile Completed bounties Tech Active attempts Options
@neo773    34 tailcallhq bounties
+ 63 bounties from 20 projects
TypeScript, Rust,
JavaScript & more
Cancel attempt

Copy link

algora-pbc bot commented Mar 13, 2024

@neo773: The Tailcall Inc. team prefers to assign a single contributor to the issue rather than let anyone attempt it right away. We recommend waiting for a confirmation from a member before getting started.

Copy link

algora-pbc bot commented Mar 13, 2024

💡 @guptadeepak8 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

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