-
Notifications
You must be signed in to change notification settings - Fork 108
Closed
Description
Hi everyone,
First of all thank you for this amazing library! But I found a strange behaviour related to type definition for an object with nested inputs.
Example:
I have a field assets
which contains another field metadata
that supports input arguments therefore I should define it using zeus autogenerated client:
const response = await client.query()({
assets: [
{
input: {
where: { ids: ['1234'] },
},
},
{
assets: {
id: true,
metadata: [
{},
{
metadata: {
field: {
tagName: true,
valueType: true,
},
'...on TextMetadata': {
value: true,
},
},
},
],
},
},
],
});
From output I'll have the next structure:
{
"data": {
"assets": {
"assets": [
{
"id": "1234",
"metadata": {
"metadata": [
{
"field": {
"tagName": "ID",
"valueType": "NUMBER"
}
}
]
}
}
]
}
}
}
But Typescript type definition for the response is only supporting first-level declaration and an another deep objects with inputs will be defined as query array.
I suppose that is a unexpected library behaviour and probably a new bug.
Thank you!
Metadata
Metadata
Assignees
Labels
No labels