Skip to content

Commit 63fafd5

Browse files
committed
Remove __typename from inline fragments in allowlist normalization
Extend the query normalization logic to handle inline fragments by recursively filtering their selection sets, ensuring __typename fields are properly removed from inline fragments as well as regular fields.
1 parent f82a439 commit 63fafd5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

server/src-lib/Hasura/RQL/Types/Allowlist.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ normalizeQuery =
192192
else
193193
let newSelset = filterSelSet $ G._fSelectionSet f
194194
in Just $ G.SelectionField f {G._fSelectionSet = newSelset}
195+
G.SelectionInlineFragment frag ->
196+
let newSelset = filterSelSet $ G._ifSelectionSet frag
197+
in Just $ G.SelectionInlineFragment frag {G._ifSelectionSet = newSelset}
195198
_ -> Just s
196199

197200
-- | InlinedAllowlist is the data type with which the allowlist is represented

0 commit comments

Comments
 (0)