Код: Выделить всё
{
tblprojects
{
id
name
}
}
Код: Выделить всё
{
tblprojects (name:"Test")
{
id
name
}
}
Код: Выделить всё
"message": "Unknown argument \"name\" on field \"tblprojects\" of type \"Query\".",
Код: Выделить всё
$queryFields = [];
foreach ($tables as $table) {
$queryFields[$table] = [
'type' => Type::listOf(new ObjectType([
'name' => ucfirst($table),
'fields' => function() use ($table) {
return $this->getFieldsFromTable($table);
},
])),
'args' => [
'id_in' => [
'type' => Type::listOf(Type::int()), // Allow filtering by an array of integers
],
],
'resolve' => function($root, $args) use ($table) {
if (isset($args['id_in']) && !empty($args['id_in'])) {
// Apply filtering if 'id_in' argument is passed
$this->db->where_in('id', $args['id_in']);
}
return $this->db->get($table)->result();
},
];
}
Как мне это сделать? Можете ли вы дать мне несколько примеров применения операторов, фильтрации и т. д., чтобы я мог попробовать в Postman?
Подробнее здесь: https://stackoverflow.com/questions/793 ... ting-query
Мобильная версия