mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-21 06:21:39 +03:00
ee15c804bc
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5080 GitOrigin-RevId: 58e5e6aab136617d1bbfc6621c89942da358b04d
30 lines
1.4 KiB
YAML
30 lines
1.4 KiB
YAML
description: Explain query with order by and array relationship's column
|
|
url: /v1/graphql/explain
|
|
status: 200
|
|
query:
|
|
query:
|
|
query: |
|
|
query {
|
|
author {
|
|
name
|
|
articles(order_by: {id: desc}){
|
|
title
|
|
}
|
|
}
|
|
}
|
|
response:
|
|
- field: author
|
|
sql: "SELECT coalesce(json_agg(\"root\" ), '[]' ) AS \"root\" FROM (SELECT row_to_json((SELECT\
|
|
\ \"_e\" FROM (SELECT \"_root.base\".\"name\" AS \"name\", \"_root.ar.root.articles\"\
|
|
.\"articles\" AS \"articles\" ) AS \"_e\" ) ) AS \"root\" FROM (SELECT\
|
|
\ * FROM \"public\".\"author\" WHERE ('true') ) AS \"_root.base\" LEFT\
|
|
\ OUTER JOIN LATERAL (SELECT coalesce(json_agg(\"articles\" ORDER BY \"root.ar.root.articles.pg.id\"\
|
|
\ DESC NULLS FIRST), '[]' ) AS \"articles\" FROM (SELECT \"_root.ar.root.articles.base\"\
|
|
.\"id\" AS \"root.ar.root.articles.pg.id\", row_to_json((SELECT \"_e\" FROM\
|
|
\ (SELECT \"_root.ar.root.articles.base\".\"title\" AS \"title\" ) AS\
|
|
\ \"_e\" ) ) AS \"articles\" FROM (SELECT * FROM \"public\".\"article\"\
|
|
\ WHERE ((\"_root.base\".\"id\") = (\"author_id\")) ORDER BY \"id\" DESC NULLS\
|
|
\ FIRST ) AS \"_root.ar.root.articles.base\" ORDER BY \"root.ar.root.articles.pg.id\"\
|
|
\ DESC NULLS FIRST ) AS \"_root.ar.root.articles\" ) AS \"_root.ar.root.articles\"\
|
|
\ ON ('true') ) AS \"_root\" "
|