hasura / hasura/graphql-engine
recurcive view
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
after creating a view, the union part does not work correctly
```sql
CREATE OR REPLACE VIEW "uztelecom"."breadcrumbs" AS
WITH RECURSIVE breadcrumbs(id) AS (
SELECT sections.id,
sections.parent_id,
sl.title
FROM (uztelecom.sections
LEFT JOIN uztelecom.section_locales sl ON ((sl.section_id = sections.id)))
UNION
SELECT s.id,
s.parent_id,
sl.title
FROM ((uztelecom.sections s
LEFT JOIN uztelecom.section_locales sl ON ((sl.section_id = s.id)))
JOIN breadcrumbs breadcrumbs_1 ON ((breadcrumbs_1.parent_id = s.parent_id)))
)
SELECT breadcrumbs.id,
breadcrumbs.parent_id,
breadcrumbs.title
FROM breadcrumbs;
```
after i will use quert with where condition
```gql
{
uztelecom_breadcrumbs(where:{id:{_eq:8}}) {
id
parent_id
title
}
}
```
Contributor guide
Research direction
No repository file or test is named. Start by reproducing the CREATE VIEW statement and the GraphQL query against PostgreSQL, then compare the filtered result with direct queries on the view; done means the recursive view and its id filter return the expected rows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, postgresql
- Domain
- api, database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100