mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 17:31:56 +03:00
chore: check we have fields in our Logical Model before outputting a parser
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10550 GitOrigin-RevId: 85f83274f696e381da68547bf7af098ea8f5ac11
This commit is contained in:
parent
75a691a1cf
commit
72e50c1556
@ -250,13 +250,22 @@ defaultLogicalModelSelectionSet logicalModel = runMaybeT do
|
||||
-- We entirely ignore Relay for now.
|
||||
implementsInterfaces = mempty
|
||||
|
||||
lift $ P.memoizeOn 'defaultLogicalModelSelectionSet fieldName do
|
||||
-- we filter out parsers that return 'Nothing' as those we are no permitted to see.
|
||||
parsers <- catMaybes <$> traverse (\(column, lmField, redactionExp) -> parseLogicalModelField mempty column lmField redactionExp) allowedColumns
|
||||
-- we filter out parsers that return 'Nothing' as those we are no permitted to see.
|
||||
parsers <-
|
||||
catMaybes
|
||||
<$> traverse
|
||||
( \(column, lmField, redactionExp) ->
|
||||
lift (parseLogicalModelField mempty column lmField redactionExp)
|
||||
)
|
||||
allowedColumns
|
||||
|
||||
pure
|
||||
$ P.selectionSetObject fieldName description parsers implementsInterfaces
|
||||
<&> parsedSelectionsToFields IR.AFExpression
|
||||
-- if we have no fields, we can't create a parser
|
||||
if null parsers
|
||||
then hoistMaybe Nothing
|
||||
else lift $ P.memoizeOn 'defaultLogicalModelSelectionSet fieldName do
|
||||
pure
|
||||
$ P.selectionSetObject fieldName description parsers implementsInterfaces
|
||||
<&> parsedSelectionsToFields IR.AFExpression
|
||||
|
||||
logicalModelSelectionList ::
|
||||
(MonadBuildSchema b r m n, BackendLogicalModelSelectSchema b) =>
|
||||
|
Loading…
Reference in New Issue
Block a user