cynic
cynic copied to clipboard
Directive support
The various derives (and probably the generator) should support passing directives in.
We should probably also offer first class support for the skip & include directives.
Need to think about how to support each of the locations for directives in executables:
Field & FragmentSpread Positions
Field position seems relatively easy, can take a similar approach to arguments:
#[derive(QueryFragment)]
struct Whatever {
#[directive(skipIf: $someVariable)]
field: String
#[cynic(spread)]
#[directive(whatever: $xyz)]
other: SomeFragment
}
Variable Definition
Similar for variable definitions
#[derive(QueryVariables)]
struct MyVariables {
#[directive(whatever: 123)]
variable: String
}
Fragment Definition
We don't currently support fragment definitions but this will need thought through if we decide to
Query & Mutation & Subscription Position
TBC
Inline Fragment
TBC