private function formatQueryElement($key, $value, EntityMetadata $metadata, Store $store)
    {
        // Handle root fields: id or model type.
        if (null !== $result = $this->formatQueryElementRoot($key, $value, $metadata)) {
            return $result;
        }

        // Handle attributes.
        if (null !== $result = $this->formatQueryElementAttr($key, $value, $metadata, $store)) {
            return $result;
        }

        // Handle relationships.
        if (null !== $result = $this->formatQueryElementRel($key, $value, $metadata, $store)) {
            return $result;
        }

        // Handle dot notated fields.
        if (null !== $result = $this->formatQueryElementDotted($key, $value, $metadata, $store)) {
            return $result;
        }

        // Pass remaining elements unconverted.
        return [$key, $value];
    }