Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditionally inner join user table if creator is present in query #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Devorein
Copy link

This PR uses issue #29 to utilize limit instead of take and conditionally inner joins the user table if the query contains the creator field, using an util method.

Copy link

@aseerkt aseerkt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix indentation for better git diff

let parent = info.operation.selectionSet;
for (let index = 0; index < fields.length; index++) {
const field = fields[index];
const selectionNode = parent.selections.find(selection=>(selection as any).name.value === field) ?? false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work with using Fragments as the name.value will resolve as the Fragment name, i.e PostSnippet

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