Skip to content

Commit

Permalink
Update documentation with the updated logic for batchKey and query fi…
Browse files Browse the repository at this point in the history
  • Loading branch information
karatakis authored Jul 24, 2024
1 parent 81ab8ec commit 9aa4796
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/N+1.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ The described changes introduce two significant tweaks to the `@http` directive:
)
}
```
This parameter instructs the system to use the user's `id`, in the `User` type, as the unique identifier. This helps in differentiating between users received from the batch API.
This parameter instructs the system to use the user's `id`, in the `User` type, as the unique identifier. This helps in differentiating between users received from the batch API. When `batchKey` is present, Tailcall considers the first `query` parameter to be the batch query parameter, so remember to adjust the order of the items accordingly.

Let's see what the server logs when you now start Tailcall with the updated configuration:

Expand Down
4 changes: 2 additions & 2 deletions docs/directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ type Mutation {

### query

Represents the API call's query parameters, either as a static object or with dynamic parameters using Mustache templates. These parameters append to the URL.
Represents the API call's query parameters, either as a static object or with dynamic parameters using Mustache templates. These parameters append to the URL. Keep in mind that when `batchKey` is present, Tailcall considers the first `query` parameter to be the batch query parameter, so remember to adjust the order of the items accordingly.

```graphql showLineNumbers
type Query {
Expand Down Expand Up @@ -950,7 +950,7 @@ In this scenario, the `User-Name` header's value will dynamically adjust accordi

### batchKey

Groups data requests into a single call, enhancing efficiency. Refer to our [n + 1 guide](./N+1.md) for more details.
Groups data requests into a single call, enhancing efficiency. Refer to our [n + 1 guide](./N+1.md) for more details. When `batchKey` is present, Tailcall considers the first `query` parameter to be the batch query parameter, so remember to adjust the order of the items accordingly.

```graphql showLineNumbers
type Post {
Expand Down

0 comments on commit 9aa4796

Please sign in to comment.