graffle-js/graffle

Add defer and stream directives as extension

Opened this issue · 0 comments

Perceived Problem

Right now defer and stream are hardcoded types of directives. In fact though at least Yoga still does not support them out of the box citing their being experimental.

This is a problem for Graffle since it suggests these directives are available when they may not be.

https://the-guild.dev/graphql/yoga-server/docs/features/defer-stream

Defer and stream are forthcoming directives to be standardized in the coming year or two.

Make them available to Graffle users.

Ideas / Proposed Solution(s)

  • Make it possible to add directives via extensions
  • Make defer and stream extensions
  • Let users opt into them
  • These directives can only appear on inline and spread fragments, a further restriction to factor into the extension system
  • When these directives are used anyware in the selection set then:
    • static type return value must become asynchronous iterator
    • any labels used should be statically realized on the return type incrementally delivered items
    • runtime must also become an asynchronous iterator too of course
    • internal unpack hook needs to not assume json response