The trial of four rightist Polish dissidents accused of attempting to overthrow the communist state opened here today.

It was the first major political trial since last summer's labor upheavals and the birth of the independent trade union federation Solidarity. The chief defendant is a 50-year-old former journalist, Leszek Moczulski, who is the founder of a nationalist dissident group called Confederation for an Independent Poland.

Moczulski and the other defendants were release from jail 10 days ago following a campaign spearheaded by Solidarity to free all political prisoners.

Their trail now is interpreted here as another move by the polish authorities in trying to steer a middle course between domestic pressures for change and Soviet calls for tougher line against dissendents. Moczulski's release last week drew a chorus of disaproval from Soviet Bloc news media, including the comment that it represented a concession to the "forces of counterrevolution."

The opening session, which lasted less than 90 minutes, was devoted to the reading of the indictment against the four defendants who were accused of attempting to mount operations aimed at overthrowing "the political structure in Poland and weakening the defense of the country."

A banner strung up out side the courtroom by sympathizers of the accused read, "Political prisoners are a shame to the Polish nation."

The major piece of evidence against Moczulski is an interview he gave to the West German news magazine Der Spiegel last September in which he declared that his organization favored the overthrow of "the communist dictatorship in Poland," The indictment alleged that he wanted to break Poland's ties with the Soviet Union and had "an obsessive hatgred of Soviet political structures."

Solidarity leaders and dissident groups, including the better known Committee for Social Self-Defense (KOR), have disassociated themselves from Moczulski's views and program. But they criticized his arrest last September and the trial.

A nationwide campaign was launched under Solidarity's auspices last December to secure the release of all political prisioners. It culminated in a series of hunger strikes last month, most of which were called off when Moczulski and the remaining members of his group were released.

Three hunger strikers, however, including Moczulski's wife, Maria, continued thier fast to demand freedom for two other prisoners -- the brothers Jerry and Ryszard Kowalczyk -- who are serving 25-year sentences for blowing up a meeting hall where policeman were due to hold a conference.

While Solidarity admits that the Kowalczyks were responsible for criminal acts, it contends that the length of their sentence was politically inspired. The release of political prisoners was one of the points covered by the Gdansk agreement signed between government and workers last August.