def METHOD_NAME(
    self,
    query,
    variables=None,
    permissions=None,
    check_no_permissions=True,
    **kwargs,
):
    """Dedicated helper for posting GraphQL queries.
    Sets the `application/json` content type and json.dumps the variables
    if present.
    """
    data = {"query": query}
    if variables is not None:
        data["variables"] = variables
    if data:
        data = json.dumps(data, cls=DjangoJSONEncoder)
    kwargs["content_type"] = "application/json"
    if permissions:
        if check_no_permissions:
            with mock.patch("saleor.graphql.utils.handled_errors_logger"):
                response = super(Client, self).post(self.api_path, data, **kwargs)
            assert_no_permission(response)
        if self.app:
            self.app.permissions.add(*permissions)
        else:
            self.user.user_permissions.add(*permissions)
    result = super(Client, self).post(self.api_path, data, **kwargs)
    flush_post_commit_hooks()
    return result