Add @export
directive to link data between fields/operations
#3119
Labels
feature
New feature or request
@export
directive to link data between fields/operations
#3119
Add a
@export
directive to query fields that dynamically populates a defined variable. This would allow field values from one query/mutation to be used within another. For now, this should be scoped to a singlemutation
orquery
block, but we can add suport for multiple/interleavesmutation
andquery
blocks in the future. DiscussionExample
Here we are defining a variable at the top of the mutation
dogID: String
which will have the resulting value from the@export
directive from the_docID @export(as: "dogID")
.Design
We will need to detect the type of the variable (strongly typed) and make sure:
@export
directive matches the variable typecreate_Dog
outputs a[Dog]
type) thenA) The variable can be a single (non list) type but the output result type can only contain a single value. In other words, the
@export
directive can only be called onceB) Otherwise, the variable must be a list type as well.
Rough outline of the implementation (from here)
selectNode
)Note: The value of the
@export
field should overwrite any existing manually provided variable valueReferences
The text was updated successfully, but these errors were encountered: