i Have following response that needs to go under GraphQL Query:
{
'0xF7446f0...9a496aE94Cf9d42': { balances: [ [Object], [Object] ] },
'0xc01679F6496...95c86f9DEc63a': { balances: [ [Object], [Object] ] }
}
Using nestjs together with graphql-type-json and my code looks like this
@ObjectType()
export class BalancesResponse {
@Field({ nullable: true })
error?: string;
@Field((type) => JSON)
balances: any;
}
but when i try to execute the requests i got this error:
"message": "Cannot return null for non-nullable field BalancesResponse.balances."
Any idea how to return it, i want to return all of the key-value pairs in the object and my key to be dynamic