public boolean isValid() {
        switch (scope) {
            case All:
                return true;
            case Service:
                return Objects.nonNull(serviceName) && Objects.nonNull(normal);
            case ServiceInstance:
                return Objects.nonNull(serviceName) && Objects.nonNull(serviceInstanceName) && Objects.nonNull(normal);
            case Endpoint:
                return Objects.nonNull(serviceName) && Objects.nonNull(endpointName) && Objects.nonNull(normal);
            case Process:
                return Objects.nonNull(serviceName) && Objects.nonNull(serviceInstanceName) && Objects.nonNull(processName) && Objects.nonNull(normal);
            case ServiceRelation:
                return Objects.nonNull(serviceName) && Objects.nonNull(destServiceName)
                    && Objects.nonNull(normal) && Objects.nonNull(destNormal);
            case ServiceInstanceRelation:
                return Objects.nonNull(serviceName) && Objects.nonNull(destServiceName)
                    && Objects.nonNull(serviceInstanceName) && Objects.nonNull(destServiceInstanceName)
                    && Objects.nonNull(normal) && Objects.nonNull(destNormal);
            case EndpointRelation:
                return Objects.nonNull(serviceName) && Objects.nonNull(destServiceName)
                    && Objects.nonNull(endpointName) && Objects.nonNull(destEndpointName)
                    && Objects.nonNull(normal) && Objects.nonNull(destNormal);
            case ProcessRelation:
                return Objects.nonNull(serviceName) && Objects.nonNull(destServiceName)
                    && Objects.nonNull(serviceInstanceName) && Objects.nonNull(destServiceInstanceName)
                    && Objects.nonNull(processName) && Objects.nonNull(destProcessName)
                    && Objects.nonNull(normal) && Objects.nonNull(destNormal);
            default:
                return false;
        }
    }
@return true if the entity field is valid. The graphql definition couldn't provide the strict validation, because
the required fields are according to the scope.
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/input/Entity.java