Hi, I would like to understand the basic philosophy behind difference between how id/ref is being placed in Fauna.
FQL in default separated ref outside the data while GraphQL includes _id inside return object.
I would like to understand why reference in FQL is excluded from the data, and what’s the best practice of using references and data at the same time.
I’m using Typescript to set my data format and being refs/id outside the data kinda disrupt my data format.
Thank you very much.
Keep in mind that GraphQL is a layer on top of FQL. You could easily change how you return your data in FQL. Take a look at this FlattenDoc
function that is pure FQL: https://github.com/shiftx/faunadb-fql-lib#flattendoc
Is it official module from fauna? I’m not sseeing FlattenDoc in faunadb module. That’s from faunadb-fql-lib