Skip to content

Conversation

@bjoyce
Copy link
Collaborator

@bjoyce bjoyce commented Sep 8, 2021

This came up because we wanted to expose a field that is derived from an association, but the association itself wasn't included in the graphql query so it wouldn't be included in associations_to_include.

This PR allows defining a new method called custom_associations_for_fields, which returns a hash where the keys are field names, and the values are any associations to include if that field is part of the query. An example is added to the readme

@bjoyce bjoyce marked this pull request as ready for review September 8, 2021 18:45
@bjoyce bjoyce requested a review from glytch September 8, 2021 18:45
@glytch glytch merged commit 7230a9d into master Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants