Cannot call @QueryMethod from child workflow

The parent workflow has a @QueryMethod and when start the child workflow, pass it the id

    public static class ParentWorkflowImpl implements ParentWorkflow {
        @Override
        public void start() {
            ChildWorkflow child1 = Workflow.newChildWorkflowStub(ChildWorkflow.class);
            Async.procedure(child1::start, Workflow.getInfo().getWorkflowId());
            Workflow.sleep(Duration.ofHours(1));
        }

        @Override
        public int query() {
            return 30;
        }
    }

When try to use the @QueryMethod from the child workflow like this

    public static class ChildWorkflowImpl implements ChildWorkflow {
        @Override
        public void start(String parentWorkflowId) {
            ParentWorkflow parentWorkflow = Workflow.newExternalWorkflowStub(ParentWorkflow.class, parentWorkflowId);
            System.out.println(parentWorkflow.query());
        }
    }

I got error: Query is not supported from workflow to workflow. Use activity that perform the query instead.
So I tried this

    public static class QueryActivityImpl implements QueryActivity {

        @Override
        public int query(String parentWorkflowId) {
            ParentWorkflow parentWorkflow = Workflow.newExternalWorkflowStub(ParentWorkflow.class, parentWorkflowId);
            return parentWorkflow.query();
        }
    }

    public static class ChildWorkflowImpl implements ChildWorkflow {
        private final ActivityOptions options = ActivityOptions.newBuilder().setStartToCloseTimeout(Duration.ofSeconds(120)).build();
        private final QueryActivity act = Workflow.newActivityStub(QueryActivity.class, options);

        @Override
        public void start(String parentWorkflowId) {
            System.out.println(act.query(parentWorkflowId));
        }
    }

Then I got the error: Called from non workflow or workflow callback thread

So is it not allowed to query parent workflow from child? If it is allowed, how do I do that?
Thank you very much!

The query usually implies periodic polling and in many situations parent sending a signal to the child upon reaching a certain state is more efficient.

If you still want to run a query from the parent use an activity. Note that only workflow code is allowed to call static methods on the Workflow class. An activity code has to use a WorkflowClient to create the workflow stub.

Nit: There is no need to pass the parentId to the child. The child can access it through

Workflow.getInfo().getParentWorkflowId()

Thank you very much!
I will change to parent signal child and avoid passing the id.