◆ setUp()
Definition at line 22 of file GraphQlIntrospectionTest.php.
25 $this->schemaFactory = $this->objectManager->get(\
Magento\Framework\GraphQl\SchemaFactory::class);
static getObjectManager()
◆ testIntrospectionQuery()
testIntrospectionQuery |
( |
| ) |
|
Definition at line 28 of file GraphQlIntrospectionTest.php.
30 $emptySchema = $this->schemaFactory->create(
32 'query' =>
new ObjectType(
35 'description' =>
'Description at type level',
36 'fields' => [
'a' => \GraphQL\Type\Definition\Type::string()]
43 query IntrospectionQuery {
51 fragment FullType
on __Type{
55 fields(includeDeprecated:
true){
63 fragment TypeRef
on __Type {
71 fragment InputValue
on __InputValue {
80 $this->assertEquals(
'Query',
$output[
'queryType'][
'name']);
81 $this->assertEquals(
$output[
'types'][0][
'kind'],
'OBJECT');
85 'description' =>
'Description at type level',
94 $this->assertContains($expectedFragment,
$output[
'types']);
taxRateField this edit on("click.mselect-delete", ".mselect-delete", function() { if(!confirm('<?=/*@escapeNotVerified */__( 'Do you really want to delete this tax rate?') ?>')) { return;} var that=$(this), select=that.closest('.mselect-list').prev(), rateValue=that.parent().find( 'input[type="checkbox"]').val();$( 'body').trigger( 'processStart');var ajaxOptions={ type:'POST', data:{ tax_calculation_rate_id:rateValue, form_key:$( 'input[name="form_key"]').val() }, dataType:'json', url:'<?=/*@escapeNotVerified */$block->getTaxRateDeleteUrl() ?>', success:function(result, status) { $( 'body').trigger( 'processStop');if(result.success) { that.parent().remove();select.find( 'option').each(function() { if(this.value===rateValue) { $(this).remove();} });select.trigger( 'change.hiddenSelect');} else { if(result.error_message) alert({ content:result.error_message });else alert({ content:'<?=/*@escapeNotVerified */__( 'An error occurred') ?>' });} }, error:function() { $( 'body').trigger( 'processStop');alert({ content:'<?=/*@escapeNotVerified */__( 'An error occurred') ?>' });} };$.ajax(ajaxOptions);}) .on( 'click.mselectAdd'
◆ testIntrospectsIncludeTheDeprecatedParameter()
testIntrospectsIncludeTheDeprecatedParameter |
( |
| ) |
|
@SuppressWarnings(PHPMD.ExcessiveMethodLength)
Definition at line 239 of file GraphQlIntrospectionTest.php.
241 $testSchema = $this->schemaFactory->create(
243 'query' =>
new ObjectType(
248 'type' => \GraphQL\Type\Definition\Type::string(),
249 'deprecationReason' =>
'Deprecated in an older version' 252 'type' => \GraphQL\Type\Definition\Type::string()
266 fields(includeDeprecated:
true){
289 'name'=>
'deprecated',
294 'description'=>
null,
295 'isDeprecated'=>
true,
296 'deprecationReason'=>
'Deprecated in an older version' 299 'name'=>
'nonDeprecated',
304 'description'=>
null,
305 'isDeprecated'=>
false,
306 'deprecationReason'=> null
310 $this->assertEquals($expectedResult,
$output);
◆ testIntrospectsInputObjectWithNonNullInputField()
testIntrospectsInputObjectWithNonNullInputField |
( |
| ) |
|
Tests an InputObjectType with NON Null field and description at Field level @SuppressWarnings(PHPMD.ExcessiveMethodLength)
Definition at line 101 of file GraphQlIntrospectionTest.php.
103 $testInputObject =
new InputObjectType(
105 'name' =>
'ProductFilterInput',
108 'type' => \GraphQL\Type\Definition\Type::nonNull(
109 \GraphQL\Type\Definition\Type::string()
111 'description' =>
'testDescriptionForA' 114 'type' => \GraphQL\Type\Definition\Type::listOf(
115 \GraphQL\Type\Definition\Type::string()
118 'attributeC' => [
'type' => \GraphQL\Type\Definition\Type::string(),
'defaultValue' =>
null],
120 'type' => \GraphQL\Type\Definition\Type::string(),
121 'defaultValue' =>
'test',
122 'description' =>
'testDescriptionForD' 127 $TestType =
new ObjectType([
131 'type' => \GraphQL\Type\Definition\Type::string(),
132 'args' => [
'complex' => [
'type' => $testInputObject]],
133 'resolve' =>
function ($args) {
134 return json_encode($args[
'complex']);
139 $testSchema = $this->schemaFactory->create(
140 [
'query' => $TestType]
159 fragment TypeRef
on __Type {
179 'kind'=>
'INPUT_OBJECT',
180 'name'=>
'ProductFilterInput',
183 'name'=>
'attributeA',
184 'description'=>
'testDescriptionForA',
194 'defaultValue'=> null
197 'name'=>
'attributeB',
198 'description'=>
null,
208 'defaultValue'=> null
211 'name'=>
'attributeC',
212 'description'=>
null,
218 'defaultValue'=>
'null' 221 'name'=>
'attributeD',
222 'description'=>
'testDescriptionForD',
228 'defaultValue'=>
'"test"' 233 $this->assertContains($expectedResult,
$output);
taxRateField this edit on("click.mselect-delete", ".mselect-delete", function() { if(!confirm('<?=/*@escapeNotVerified */__( 'Do you really want to delete this tax rate?') ?>')) { return;} var that=$(this), select=that.closest('.mselect-list').prev(), rateValue=that.parent().find( 'input[type="checkbox"]').val();$( 'body').trigger( 'processStart');var ajaxOptions={ type:'POST', data:{ tax_calculation_rate_id:rateValue, form_key:$( 'input[name="form_key"]').val() }, dataType:'json', url:'<?=/*@escapeNotVerified */$block->getTaxRateDeleteUrl() ?>', success:function(result, status) { $( 'body').trigger( 'processStop');if(result.success) { that.parent().remove();select.find( 'option').each(function() { if(this.value===rateValue) { $(this).remove();} });select.trigger( 'change.hiddenSelect');} else { if(result.error_message) alert({ content:result.error_message });else alert({ content:'<?=/*@escapeNotVerified */__( 'An error occurred') ?>' });} }, error:function() { $( 'body').trigger( 'processStop');alert({ content:'<?=/*@escapeNotVerified */__( 'An error occurred') ?>' });} };$.ajax(ajaxOptions);}) .on( 'click.mselectAdd'
The documentation for this class was generated from the following file: