def METHOD_NAME(exc: TransportQueryError, query: graphql.DocumentNode):
    """Create instance from a gql exception."""
    try:
        errors = cattrs.structure(exc.errors, list[QueryErrorValue])
    except (TypeError, KeyError, ValueError):
        return None
    return QueryError(errors, query) if errors else None