Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
IntrospectionQueryTest.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
8 namespace Magento\GraphQl;
9 
11 
13 {
19  {
20  $query
21  = <<<QUERY
22 query IntrospectionQuery {
23  __schema {
24  queryType { name }
25  types{
26  ...FullType
27  }
28  }
29  }
30 fragment FullType on __Type{
31  name
32  kind
33  fields(includeDeprecated:true){
34  name
35  args{
36  ...InputValue
37  }
38  }
39  }
40 
41 fragment TypeRef on __Type {
42  kind
43  name
44  ofType{
45  kind
46  name
47  }
48 }
49 fragment InputValue on __InputValue {
50  name
51  description
52  type { ...TypeRef }
53  defaultValue
54 }
55 QUERY;
56 
57  $this->expectException(\Exception::class);
58  $this->expectExceptionMessage(
59  'GraphQL response contains errors: GraphQL introspection is not allowed, but ' .
60  'the query contained __schema or __type'
61  );
62  $this->graphQlQuery($query);
63  }
64 }
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'
Definition: edit.phtml:164
graphQlQuery(string $query, array $variables=[], string $operationName='', array $headers=[])