graphile / crystal

🔮 Graphile's Crystal Monorepo; home to Grafast, PostGraphile, pg-introspection, pg-sql2 and much more!
https://graphile.org/
Other
12.62k stars 571 forks source link

`fieldArgs.getRaw` and related methods should throw if called out of turn #2130

Closed benjie closed 3 months ago

benjie commented 4 months ago

A user in Discord wrote this (incorrect) code:

resetMyData(_: any, fieldArgs: any) {
  const result = sideEffect(null, async () => {
    const $input = fieldArgs.getRaw("input");
    console.log($input)
  }
}

The fieldArgs.getRaw at execution time should raise an error.