Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
modified example to demonstrate usage of ArgumentObject
  • Loading branch information
eduard-gr committed Aug 26, 2025
commit 0788ed91db0a6ebdb09fa2dbc4831f0b45e402d5
9 changes: 8 additions & 1 deletion examples/query_example.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require_once __DIR__ . '/../vendor/autoload.php';

use GraphQL\ArgumentObject;
use GraphQL\Client;
use GraphQL\Exception\QueryError;
use GraphQL\Query;
Expand All @@ -15,7 +16,13 @@

// Create the GraphQL query
$gql = (new Query('pokemon'))
->setArguments(['name' => 'Pikachu'])
->setArguments([
'name' => 'Pikachu',
'age' => new ArgumentObject([
'min' => 7,
'max' => 20
]),
])
->setSelectionSet(
[
'id',
Expand Down