server: fix namespace visibility during introspection

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4971
GitOrigin-RevId: 0ed090b61da65849466607c29480f031f241e929
This commit is contained in:
paritosh-08 2022-07-06 11:10:16 +05:30 committed by hasura-bot
parent 4b4a11dd07
commit 2498176052
3 changed files with 48 additions and 1 deletions

View File

@ -58,7 +58,7 @@
### Bug fixes and improvements
- server: fix namespace visibility during introspection (fix #8434)
- server: Create missing SQL triggers, if any, while reloading metadata and startup.
- server: fix name transformation bug in `graphql-default` naming convention (fixes #8640 partially)
- server: changes to the Rest Endpoints OpenAPI specification:

View File

@ -88,6 +88,7 @@ customizeNamespace ::
P.MkTypename ->
[FieldParser n a] ->
[FieldParser n (NamespacedField a)]
customizeNamespace (Just _) _ _ [] = [] -- The nampespace doesn't contain any Field parsers, so returning empty list
customizeNamespace (Just namespace) fromParsedSelection mkNamespaceTypename fieldParsers =
-- Source or remote schema has a namespace field so wrap the parsers
-- in a new namespace field parser.

View File

@ -161,6 +161,52 @@
}
}
- description: Create user role
url: /v1/metadata
status: 200
query:
type: pg_create_select_permission
args:
table: author_local
role: user
permission:
columns: '*'
filter: {}
source: pg1
response:
message: success
- description: Check namespace visibility
url: /v1/graphql
headers:
X-Hasura-Role: user
status: 200
response:
errors:
- extensions:
code: validation-failed
path: $.selectionSet.s2
message: "field \"s2\" not found in type: 'query_root'"
query:
query: |
query MyQuery {
s2 {
__typename
}
}
- description: Drop user role
url: /v1/metadata
status: 200
query:
type: pg_drop_select_permission
args:
role: user
source: pg1
table: author_local
response:
message: success
- description: untrack table 1
url: /v1/metadata