GraphQL\Tests\StarWarsIntrospectionTest::testAllowsQueryingTheSchemaForNestedObjectFields PHP Метод

testAllowsQueryingTheSchemaForNestedObjectFields() публичный Метод

    public function testAllowsQueryingTheSchemaForNestedObjectFields()
    {
        $query = '
        query IntrospectionDroidNestedFieldsQuery {
          __type(name: "Droid") {
            name
            fields {
              name
              type {
                name
                kind
                ofType {
                  name
                  kind
                }
              }
            }
          }
        }
        ';
        $expected = ['__type' => ['name' => 'Droid', 'fields' => [['name' => 'id', 'type' => ['name' => null, 'kind' => 'NON_NULL', 'ofType' => ['name' => 'String', 'kind' => 'SCALAR']]], ['name' => 'name', 'type' => ['name' => 'String', 'kind' => 'SCALAR', 'ofType' => null]], ['name' => 'friends', 'type' => ['name' => null, 'kind' => 'LIST', 'ofType' => ['name' => 'Character', 'kind' => 'INTERFACE']]], ['name' => 'appearsIn', 'type' => ['name' => null, 'kind' => 'LIST', 'ofType' => ['name' => 'Episode', 'kind' => 'ENUM']]], ['name' => 'secretBackstory', 'type' => ['name' => 'String', 'kind' => 'SCALAR', 'ofType' => null]], ['name' => 'primaryFunction', 'type' => ['name' => 'String', 'kind' => 'SCALAR', 'ofType' => null]]]]];
        $this->assertValidQuery($query, $expected);
    }