Skip to content

Understanding Pointers #109

Answered by cbaker6
proj-sashido asked this question in Q&A
Discussion options

You must be logged in to vote

I can’t remove the Pointer in both structs, because I would then have a stored property that recursively contains itself.

The compiler providing this type of error is a suggestion towards a design improvement in your schema (you are basically designing in a way that can create cycles). If you want to keep your current schema setup then the extra fetch you mentioned works as a solution and include won't help because if you create a cycle you could end up making your server go in an infinite recursion loop. You can also look at relations, but you will most likely still need the extra fetch. The pointer in Playgrounds demonstrates the solution you posted as well as others.

You can also loo…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cbaker6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants