In the comments array, I need to replace the keys with the date the comment was created, is it possible to do this? #937
Answered
by
mfn
zabavnikov
asked this question in
Q&A
-
I tried to do this in the CommenQuery, but the array is returned with the usual keys. return $comments->limit($args['limit'])->get()->mapWithKeys(function ($item, $key) {
$stack = Carbon::parse($item['created_at'])->format('Ymd');
return [$stack => $item];
})->all(); |
Beta Was this translation helpful? Give feedback.
Answered by
mfn
Aug 26, 2022
Replies: 1 comment
-
No, that's not possible. But that's not a limit of neither this library or the underlying GraphQL PHP library: it's a shortcoming in the official GraphQL specification. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
zabavnikov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No, that's not possible.
But that's not a limit of neither this library or the underlying GraphQL PHP library: it's a shortcoming in the official GraphQL specification.