Skip to content

Non-CLI parts of the library must not write anything to stdout/stderr #678

@outring

Description

@outring

Issue summary

Currently, if the error happens during the GraphQL request the response body is being printed to stdout along with an empty line

Libraries must not print anything to the console because they're being used in other applications and the way these applications treat the stdout/stderr could vary:

  • User-facing CLIs could use the the stdout to present the data to users and they do it in a way they need it. Having a raw response in the stdout wouldn't be a desirable behavior
  • Server-side application often use stdout/stderr to stream logs. And logs are often expected to be in a certain format. Unexpectedly formatted log entries can negatively affect log viewers/analyzers

Expected behavior

The library doesn't do raw prints to the stdout. It does the logging using the standard way of logging in Python using logging module

Actual behavior

The library prints raw GraphQL responses

Steps to reproduce the problem

  1. Issue an incorrect request to GraphQL API which leads to a HTTP error

Reduced test case

N/A


Checklist

  • I have described this issue in a way that is actionable (if possible)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions