graphql-engine/server/tests-py/queries/explain/permissions_query_mssql.yaml
Abby Sassel c9e7e10eaa server/bugfix: Include permission filter in the exists clause. Fixes #6931
GitOrigin-RevId: d3080dfa00c96afcf1254d83757a5e50a0726381
2021-05-24 09:09:50 +00:00

30 lines
1.4 KiB
YAML

description: Explain query with permissions
url: /v1/graphql/explain
status: 200
response:
- field: user
sql:
"SELECT ISNULL((SELECT [t_user1].[id] AS [id],\n [t_user1].[name] AS\
\ [name],\n [t_user1].[age] AS [age]\nFROM [dbo].[user] AS [t_user1]\nOUTER\
\ APPLY (SELECT *\n FROM OPENJSON((N''+NCHAR(123)+''+NCHAR(34)+'positionalArguments'+NCHAR(34)+''+NCHAR(58)+''+NCHAR(91)+''+NCHAR(93)+','+NCHAR(34)+'namedArguments'+NCHAR(34)+''+NCHAR(58)+''+NCHAR(123)+''+NCHAR(125)+','+NCHAR(34)+'session'+NCHAR(34)+''+NCHAR(58)+''+NCHAR(123)+''+NCHAR(34)+'x-hasura-user-id'+NCHAR(34)+''+NCHAR(58)+''+NCHAR(34)+'1'+NCHAR(34)+''+NCHAR(125)+''+NCHAR(125)+''))\n\
\ WITH ([session] NVARCHAR(MAX) AS JSON,\n \
\ [namedArguments] NVARCHAR(MAX) AS JSON,\n [positionalArguments]\
\ NVARCHAR(MAX) AS JSON) AS [row]\n WHERE (1=1)) \nAS [row]\nWHERE\
\ ((((([t_user1].[id]) = (JSON_VALUE([row].[session], (N''+NCHAR(36)+'.'+NCHAR(34)+'x-hasura-user-id'+NCHAR(34)+''))))\n\
\ OR ((([t_user1].[id]) IS NULL)\n AND ((JSON_VALUE([row].[session],\
\ (N''+NCHAR(36)+'.'+NCHAR(34)+'x-hasura-user-id'+NCHAR(34)+''))) IS NULL)))))\n\
FOR JSON PATH), '[]')"
query:
user:
X-Hasura-Role: user
X-Hasura-User-Id: "1"
query:
query: |
query {
user{
id
name
age
}
}