Automattic\WooCommerce\Vendor\GraphQL\Type

Introspection::getIntrospectionQuerypublic staticWC 1.0

Method of the class: Introspection{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = Introspection::getIntrospectionQuery( $options ): string;
$options(IntrospectionOptions)
.
Default: []

Introspection::getIntrospectionQuery() code WC 10.9.1

public static function getIntrospectionQuery(array $options = []): string
{
    $optionsWithDefaults = array_merge([
        'descriptions' => true,
        'directiveIsRepeatable' => false,
        'schemaDescription' => false,
        'typeIsOneOf' => false,
    ], $options);

    $descriptions = $optionsWithDefaults['descriptions']
        ? 'description'
        : '';
    $directiveIsRepeatable = $optionsWithDefaults['directiveIsRepeatable']
        ? 'isRepeatable'
        : '';
    $schemaDescription = $optionsWithDefaults['schemaDescription']
        ? $descriptions
        : '';
    $typeIsOneOf = $optionsWithDefaults['typeIsOneOf']
        ? 'isOneOf'
        : '';

    return <<<GRAPHQL
  query IntrospectionQuery {
__schema {
  {$schemaDescription}
  queryType { name }
  mutationType { name }
  subscriptionType { name }
  types {
    ...FullType
  }
  directives {
    name
    {$descriptions}
    args(includeDeprecated: true) {
      ...InputValue
    }
    {$directiveIsRepeatable}
    locations
  }
}
  }

  fragment FullType on __Type {
kind
name
{$descriptions}
{$typeIsOneOf}
fields(includeDeprecated: true) {
  name
  {$descriptions}
  args(includeDeprecated: true) {
    ...InputValue
  }
  type {
    ...TypeRef
  }
  isDeprecated
  deprecationReason
}
inputFields(includeDeprecated: true) {
  ...InputValue
}
interfaces {
  ...TypeRef
}
enumValues(includeDeprecated: true) {
  name
  {$descriptions}
  isDeprecated
  deprecationReason
}
possibleTypes {
  ...TypeRef
}
  }

  fragment InputValue on __InputValue {
name
{$descriptions}
type { ...TypeRef }
defaultValue
isDeprecated
deprecationReason
  }

  fragment TypeRef on __Type {
kind
name
ofType {
  kind
  name
  ofType {
    kind
    name
    ofType {
      kind
      name
      ofType {
        kind
        name
        ofType {
          kind
          name
          ofType {
            kind
            name
            ofType {
              kind
              name
            }
          }
        }
      }
    }
  }
}
  }
GRAPHQL;
}