Как запросить все поля, не записывая длинный запрос, включающий имена всех полей?
Например, если у меня есть эти поля:
Код: Выделить всё
public function fields()
{
return [
'id' => [
'type' => Type::nonNull(Type::string()),
'description' => 'The id of the user'
],
'username' => [
'type' => Type::string(),
'description' => 'The email of user'
],
'count' => [
'type' => Type::int(),
'description' => 'login count for the user'
]
];
}
Код: Выделить всё
FetchUsers{users(id:"2"){id,username,count}}
Код: Выделить всё
FetchUsers{users(id:"2"){*}}
//or
FetchUsers{users(id:"2")}
Я использую Folkloreatelier/ библиотека laravel-graphql.
Подробнее здесь: https://stackoverflow.com/questions/341 ... long-query