graphql/error/print_error.py
def print_error(error: "GraphQLError") -> str:
    """Print a GraphQLError to a string.

    The printed string will contain useful location information about the
    error's position in the source.
    """
    printed_locations: List[str] = []
    print_location = printed_locations.append
    if error.nodes:
        for node in error.nodes:
            if node.loc:
                print_location(
                    highlight_source_at_location(
                        node.loc.source, node.loc.source.get_location(node.loc.start)
                    )
                )
    elif error.source and error.locations:
        source = error.source
        for location in error.locations:
            print_location(highlight_source_at_location(source, location))
    if printed_locations:
        return "\n\n".join([error.message] + printed_locations) + "\n"
    return error.message
Print a GraphQLError to a string.

    The printed string will contain useful location information about the
    error's position in the source.
    
Print a GraphQLError to a string.
The printed string will contain useful location information about the
error's position in the source.
Print a GraphQLError to a string . The printed string will contain useful location information about the error ' s position in the source .
def print_error(error: "GraphQLError") -> str:
    printed_locations: List[str] = []
    print_location = printed_locations.append
    if error.nodes:
        for node in error.nodes:
            if node.loc:
                print_location(
                    highlight_source_at_location(
                        node.loc.source, node.loc.source.get_location(node.loc.start)
                    )
                )
    elif error.source and error.locations:
        source = error.source
        for location in error.locations:
            print_location(highlight_source_at_location(source, location))
    if printed_locations:
        return "\n\n".join([error.message] + printed_locations) + "\n"
    return error.message
def print_error ( error : "GraphQLError" ) -> str : printed_locations : List [ str ] = [ ] print_location = printed_locations . append if error . nodes : for node in error . nodes : if node . loc : print_location ( highlight_source_at_location ( node . loc . source , node . loc . source . get_location ( node . loc . start ) ) ) elif error . source and error . locations : source = error . source for location in error . locations : print_location ( highlight_source_at_location ( source , location ) ) if printed_locations : return "\n\n" . join ( [ error . message ] + printed_locations ) + "\n" return error . message
Print a GraphQLError to a string.
Print a GraphQLError to a string .
"""Print a GraphQLError to a string.

    The printed string will contain useful location information about the
    error's position in the source.
    """
error
"GraphQLError"