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'
]
];
}
< /code>
Запросить все поля Обычно запрос - это примерно так: < /p>
FetchUsers{users(id:"2"){id,username,count}}
< /code>
Но я хочу, чтобы способ иметь одинаковые результаты, не написав все поля, что -то вроде этого: < /p>
FetchUsers{users(id:"2"){*}}
//or
FetchUsers{users(id:"2")}
Предположим, что у вас есть тип GraphQL, и он включает в себя множество полей.[code] 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' ]
]; } < /code>
Запросить все поля Обычно запрос - это примерно так: < /p>