commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-api
src
Models
GraphQl
GraphQLRequestBuilder.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Models\GraphQl
;
10
11
use
Commercetools\Base\Builder
;
12
use
Commercetools\Base\DateTimeImmutableCollection
;
13
use
Commercetools\Base\JsonObject
;
14
use
Commercetools\Base\JsonObjectModel
;
15
use
Commercetools\Base\MapperFactory
;
16
use stdClass;
17
21
final
class
GraphQLRequestBuilder
implements
Builder
22
{
27
private
$query;
28
33
private
$operationName;
34
39
private
$variables;
40
45
public
function
getQuery
()
46
{
47
return
$this->query;
48
}
49
54
public
function
getOperationName
()
55
{
56
return
$this->operationName;
57
}
58
63
public
function
getVariables
()
64
{
65
return
$this->variables instanceof
GraphQLVariablesMapBuilder
? $this->variables->
build
() : $this->variables;
66
}
67
72
public
function
withQuery
(?
string
$query)
73
{
74
$this->query = $query;
75
76
return
$this;
77
}
78
83
public
function
withOperationName
(?
string
$operationName)
84
{
85
$this->operationName = $operationName;
86
87
return
$this;
88
}
89
94
public
function
withVariables
(?
GraphQLVariablesMap
$variables)
95
{
96
$this->variables = $variables;
97
98
return
$this;
99
}
100
105
public
function
withVariablesBuilder
(?
GraphQLVariablesMapBuilder
$variables)
106
{
107
$this->variables = $variables;
108
109
return
$this;
110
}
111
112
public
function
build
():
GraphQLRequest
113
{
114
return
new
GraphQLRequestModel
(
115
$this->query,
116
$this->operationName,
117
$this->variables instanceof
GraphQLVariablesMapBuilder
? $this->variables->
build
() : $this->variables
118
);
119
}
120
121
public
static
function
of
():
GraphQLRequestBuilder
122
{
123
return
new
self
();
124
}
125
}
Commercetools\Api\Models\GraphQl\GraphQLRequestBuilder
Definition:
GraphQLRequestBuilder.php:22
Commercetools\Api\Models\GraphQl\GraphQLRequestBuilder\getQuery
getQuery()
Definition:
GraphQLRequestBuilder.php:45
Commercetools\Api\Models\GraphQl\GraphQLRequestBuilder\withOperationName
withOperationName(?string $operationName)
Definition:
GraphQLRequestBuilder.php:83
Commercetools\Api\Models\GraphQl\GraphQLRequestBuilder\getVariables
getVariables()
Definition:
GraphQLRequestBuilder.php:63
Commercetools\Api\Models\GraphQl\GraphQLRequestBuilder\getOperationName
getOperationName()
Definition:
GraphQLRequestBuilder.php:54
Commercetools\Api\Models\GraphQl\GraphQLRequestBuilder\of
static of()
Definition:
GraphQLRequestBuilder.php:121
Commercetools\Api\Models\GraphQl\GraphQLRequestBuilder\withVariables
withVariables(?GraphQLVariablesMap $variables)
Definition:
GraphQLRequestBuilder.php:94
Commercetools\Api\Models\GraphQl\GraphQLRequestBuilder\withVariablesBuilder
withVariablesBuilder(?GraphQLVariablesMapBuilder $variables)
Definition:
GraphQLRequestBuilder.php:105
Commercetools\Api\Models\GraphQl\GraphQLRequestBuilder\build
build()
Definition:
GraphQLRequestBuilder.php:112
Commercetools\Api\Models\GraphQl\GraphQLRequestBuilder\withQuery
withQuery(?string $query)
Definition:
GraphQLRequestBuilder.php:72
Commercetools\Api\Models\GraphQl\GraphQLRequestModel
Definition:
GraphQLRequestModel.php:21
Commercetools\Api\Models\GraphQl\GraphQLVariablesMapBuilder
Definition:
GraphQLVariablesMapBuilder.php:22
Commercetools\Api\Models\GraphQl\GraphQLVariablesMapBuilder\build
build()
Definition:
GraphQLVariablesMapBuilder.php:23
Commercetools\Base\DateTimeImmutableCollection
Definition:
DateTimeImmutableCollection.php:21
Commercetools\Base\JsonObjectModel
Definition:
JsonObjectModel.php:15
Commercetools\Base\MapperFactory
Definition:
MapperFactory.php:16
Commercetools\Api\Models\GraphQl\GraphQLRequest
Definition:
GraphQLRequest.php:15
Commercetools\Api\Models\GraphQl\GraphQLVariablesMap
Definition:
GraphQLVariablesMap.php:15
Commercetools\Base\Builder
Definition:
Builder.php:16
Commercetools\Base\JsonObject
Definition:
JsonObject.php:15
Commercetools\Api\Models\GraphQl
Definition:
GraphQLError.php:9
Generated by
1.9.1