code: def pretty_print_graphql(query, use_four_spaces=True):
      
      # Use our custom visitor, which fixes directive argument order
      # to get the canonical representation
      output = visit(parse(query), CustomPrintingVisitor())
  
      # Using four spaces for indentation makes it easier to edit in
      # Python source files.
      if use_four_spaces:
          return fix_indentation_depth(output)
      return output
docs: Take a GraphQL query, pretty print it, and return it.