GraphQL - Relationship properties

Hello,

I have a dataset where the edges should be able to store an int for ordering (tracks in a playlist with a playlist position). The relation is stored as it’s own collection, so if I were just using FQL I count add a field to that but I’m using graphql, and from what I can gather there isn’t any support for edge variables yet in fauna.

Does anyone know of a workaround for this?

Thanks

I think, explicitly defining the relation yourself as a GraphQL type instead of relying on Fauna’s GraphQL schema generator to make a many-to-many intermediate collection could work? Fauna will only generate that kind of ‘relation’ collection if two types A and B link to each other. So instead you could have a new type in your GraphQL schema C:

C has a reference to A
C has a reference to B

The only inconvenience here would be that when writing a GraphQL query you now have to explicitly traverse from A to C to B instead of directly from A to B.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.