Zendro-dev / graphql-server-model-codegen

Command line utility to auto-generate the structure files for a graphql server
MIT License
1 stars 2 forks source link

fix: cassandra field resolver #188

Closed coeit closed 3 years ago

coeit commented 3 years ago

Summary

Closes #186

Associations with the targetStoragetType set to Cassandra have some restrictions on searching. Since the association is resolved via adding a search for either eq to the respective foreignkey or in the foreignkey array in case the association is of type many_to_many. Cassandra does not allow multiple Equal restrictions on the id field, the driver will throw an Error. To circumvent that a workaround where searches on the idField are merged with the search on the foreignkey(s) is implemented.

Be aware that the workaround only works because cassandra does not support the OR operator. There are also the following pitfalls to consider:

Related PRs

Additional Changes