Replies: 4 comments 5 replies
-
I feel like this is also why batching can't work in this case? ( |
Beta Was this translation helpful? Give feedback.
-
I think what i'm looking for is a bit like the schema
@server(port: 8000)
@upstream(baseURL: "http://jsonplaceholder.typicode.com") {
query: Query
}
type Query {
users: [User] @http(path: "/users")
}
type User {
id: Int!
name: String!
username: String!
email: String!
posts: [Post] @http(path: "/users/{{.value.id}}/posts") @select(path: "posts")
}
type Post {
id: Int!
userId: Int!
title: String!
body: String!
} (considering this payload: {
"posts": [
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
},
{
"userId": 1,
"id": 2,
"title": "qui est esse",
"body": "est rerum tempore vitae\nsequi sint nihil reprehenderit dolor beatae ea dolores neque\nfugiat blanditiis voluptate porro vel nihil molestiae ut reiciendis\nqui aperiam non debitis possimus qui neque nisi nulla"
}
],
"meta": {
"page": 1,
"per_page": 10,
"total": 2,
"total_pages": 1
}
} ) |
Beta Was this translation helpful? Give feedback.
-
@angristan Please try — https://github.com/tailcallhq/tailcall/releases/tag/v0.97.0 |
Beta Was this translation helpful? Give feedback.
-
@angristan Were you able to try with the latest release? Can you specify a repro for this with the exact tailcall version with the actual vs expected. |
Beta Was this translation helpful? Give feedback.
-
With the usual example of response: (https://jsonplaceholder.typicode.com/users/1/posts)
the schema can nicely be:
However if the response is of this format:
Then I'm able to get the info like this:
But it's leaking the underlying API call. Is there a wat to basically
jq .posts
to be able to get the first schema with the second JSON response?Beta Was this translation helpful? Give feedback.
All reactions