-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Hi,
Before when using the Analyze button I could see the permissions applied to the query.
For example in version 1.0.0-beta-8 (not sure when this changed, this version is just an old one I had laying around), the following permission:
{"id":{"_eq":"x-hasura-user-id"}}
Will generate the following query in the Analyze button:
SELECT
coalesce(json_agg("root"), '[]') AS "root"
FROM
(
SELECT
row_to_json(
(
SELECT
"_1_e"
FROM
(
SELECT
"_0_root.base"."id" AS "id"
) AS "_1_e"
)
) AS "root"
FROM
(
SELECT
*
FROM
"public"."image"
WHERE
(
(
("public"."image"."id") = (('582605c8-c888-4a06-bd78-908be1e4f1ec') :: uuid)
)
OR (
(("public"."image"."id") IS NULL)
AND (
(('582605c8-c888-4a06-bd78-908be1e4f1ec') :: uuid) IS NULL
)
)
)
) AS "_0_root.base"
) AS "_2_root"But in the latest version of Hasura (v1.2.1), the same permission will generate the following query in the Analyze button:
SELECT
coalesce(json_agg("root"), '[]') AS "root"
FROM
(
SELECT
row_to_json(
(
SELECT
"_1_e"
FROM
(
SELECT
"_0_root.base"."id" AS "id"
) AS "_1_e"
)
) AS "root"
FROM
(
SELECT
*
FROM
"public"."image"
WHERE
('true')
) AS "_0_root.base"
) AS "_2_root"The query results will be corrrect, just the generated query that won't.
Was this intentional? If it was, is there a way to show the permissions in the Analyze button? For more complicated queries and permissions I use the Analyze to try to optimize a few things. But if the applied permissions are not there, it will be hard to change the permissions or the database structure to optimize my queries.
Thanks