Skip to content

Conversation

GramParallelo
Copy link

@GramParallelo GramParallelo commented Jun 18, 2020

Hello,

First off, Thanks for the package!

In reducing query count I found that I didn't want eager-load a nested relationship. The following pseudo code hopefully explains the situation.

/// PostController
responder()->success($posts, PostTransformer::class)->with('comments.user')->response();

/// PostTransformer 
relations = ['comments' => CommentsTransformer::class']

/// CommentsTransformer
relations = ['user' => UserTransformer::class];
includeUser() { // ... do whatever, ex. grab user from cache instead of eager-load // }

Let me know, thanks!

@GramParallelo GramParallelo marked this pull request as ready for review June 18, 2020 17:33
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.

1 participant