code: def test_nested_query(client):
      query = gql(
          """
          query NestedQuery {
            hero {
              name
              friends {
                name
                appearsIn
                friends {
                  name
                }
              }
            }
          }
      """
      )
      expected = {
          "hero": {
              "name": "R2-D2",
              "friends": [
                  {
                      "name": "Luke Skywalker",
                      "appearsIn": ["NEWHOPE", "EMPIRE", "JEDI"],
                      "friends": [
                          {
                              "name": "Han Solo",
                          },
                          {
                              "name": "Leia Organa",
                          },
                          {
                              "name": "C-3PO",
                          },
                          {
                              "name": "R2-D2",
                          },
                      ],
                  },
                  {
                      "name": "Han Solo",
                      "appearsIn": ["NEWHOPE", "EMPIRE", "JEDI"],
                      "friends": [
                          {
                              "name": "Luke Skywalker",
                          },
                          {
                              "name": "Leia Organa",
                          },
                          {
                              "name": "R2-D2",
                          },
                      ],
                  },
                  {
                      "name": "Leia Organa",
                      "appearsIn": ["NEWHOPE", "EMPIRE", "JEDI"],
                      "friends": [
                          {
                              "name": "Luke Skywalker",
                          },
                          {
                              "name": "Han Solo",
                          },
                          {
                              "name": "C-3PO",
                          },
                          {
                              "name": "R2-D2",
                          },
                      ],
                  },
              ],
          }
      }
      result = client.execute(query)
      assert result == expected
  
file_path: wandb/wandb/vendor/gql-0.2.0/tests/starwars/test_query.py
imports: import pytest
  from graphql.error import format_error
  from gql import Client, gql
  from .schema import StarWarsSchema
label_desc: Use image node_id 4 for calling a global function with example usage: test_nested_query(client) without return types