crystal icon indicating copy to clipboard operation
crystal copied to clipboard

Since the rewrite from depth-first to breadth-first planning errors aren't field-local

Open benjie opened this issue 6 months ago • 1 comments

Planning errors now bubble to the operation root; for example if you return a PgUnionAllSingleStep in a list position that's expecting a PgSelectSingleStep the entire operation gets rejected.

We might be able to solve this by moving to the generator/yield pattern to enable catching errors in nested positions at higher levels whilst still allowing the code to be breadth first

benjie avatar May 30 '25 12:05 benjie

See commit d9d33c776be0d9ac64e4266a0be987a93d6a2b29 with UPDATE_SNAPSHOTS=1 yarn jest __tests__/queries/refs/books-related-people-plural-ref.test.graphql

benjie avatar May 30 '25 12:05 benjie

This is no longer the case; I just checked via

{
  errorTests {
    nested {
      nestedList {
        nested {
          planningError
        }
      }
    }
  }
}

against

https://github.com/graphile/crystal/blob/41a87eae4605f7ee19c3b10c21419177f10875d4/postgraphile/postgraphile/graphile.config.ts#L527-L546

benjie avatar Aug 31 '25 14:08 benjie