Skip to content

references inside and into nested struct-templates ("graph-templates") #1725

Answered by myitcv
georgfaust asked this question in Q&A
Discussion options

You must be logged in to vote

Can you not leverage the uniqueness you already have in your structure?

i.e. your foos struct defines fields for each #foo instance, and within each #foo, the items each have a unique key. So then identify each #item by that unique path:

https://cuelang.org/play/?id=v24ulXI8rrE#cue@export@cue

As you say, this "uniqueness" only needs to exist within the model itself, hence you don't need true UUIDs.

If you wanted to define the references to actual #item values and have the export (i.e. manifestation) of the configuration reduce that to the id then you could do something like:

https://cuelang.org/play/?id=2TE1qNGGsST#cue@export@cue

Note that whilst this syntax looks a bit clunky today, it i…

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@georgfaust
Comment options

@myitcv
Comment options

@georgfaust
Comment options

@myitcv
Comment options

@georgfaust
Comment options

Answer selected by georgfaust
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants