-
Notifications
You must be signed in to change notification settings - Fork 261
fix(#2489): Modify batchKey logic #2495
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
Conversation
💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe. |
Need to update the docs here — https://github.com/tailcallhq/tailcallhq.github.io/pulls |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2495 +/- ##
==========================================
- Coverage 87.29% 87.24% -0.06%
==========================================
Files 253 253
Lines 23679 23674 -5
==========================================
- Hits 20671 20654 -17
- Misses 3008 3020 +12 ☔ View full report in Codecov by Sentry. |
Next documentation changes: |
I'm not able to get this to work. What batching key should I use for my example in #2489? I'm trying |
The PR doesn't have batchPath, the summary of this PR is misleading, the tests in the implementation are using batchKey twice and the docs doesn't seem to reflect the changes or maybe needs some enhancements ?! https://tailcall.run/docs/tailcall-dsl-graphql-custom-directives/#batchkey-1 Here's my take on this since I spent some time trying to tackle this issue. For your configuration to work with this PR you will need to have the following Transaction type type Transaction {
bank_account_id: String!
bank_accounts: [BankAccount!]!
@http(
path: "/bank_accounts"
query: [{key: "bank_account_ids[]", value: "{{.value.bank_account_id}}"}]
batchKey: "bank_account_ids[]"
batchKey: ["bank_accounts", "id"]
)
id: ID!
slug: String!
} Hope this helps ! |
Actually you might not even need to specify :
it's a little bit of guess work tbh and the docs doesn't do a good job in describing the batch path |
@bnchi you are right. I need to work better on the documentation. It is true very misleading. And your configuration is correct, but you copied my mistake. Below is the fixed version. type Transaction {
bank_account_id: String!
bank_accounts: [BankAccount!]!
@http(
path: "/bank_accounts"
query: [{key: "bank_account_ids[]", value: "{{.value.bank_account_id}}"}]
batchKey: ["bank_accounts", "id"]
)
id: ID!
slug: String!
} If the I apologize for the inconvenience. Thanks for the feedback 🤟, and I will fix everything ASAP! |
Thanks! My issue was that I was still deserializing to Now, I'm also noticing the same issue as #2497 (comment), there is two batched call to the API 🤔
|
The change you linked has not been merged with the main branch. If there is something that concerns you could you please open a new issue so we can track it seperate, thank you! |
I'm talking about this PR 😄 |
I would love to investigate it further. @angristan, can you provide me with the Tailcall configuration so I can investigate? |
Summary:
query
>key
is now used to state which query parameter is used for the batchingIf
key
is not present Tailcall will use the last item ofbatchPath
batchPath
is used to instruct Tailcall how to groupBy items/claim #2489
Issue Reference(s):
Fixes #2489
Build & Testing:
cargo test
successfully../lint.sh --mode=fix
to fix all linting issues raised by./lint.sh --mode=check
.Checklist:
<type>(<optional scope>): <title>