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

don't call underlying services on empty queries #519

Merged
merged 5 commits into from
Jun 13, 2024

Conversation

temaEmelyan
Copy link
Member

Please make sure you consider the following:

  • Add tests that use __typename in queries
  • Does this change work with all nadel transformations (rename, type rename, hydration, etc)? Add tests for this.
  • Is it worth using hints for this change in order to be able to enable a percentage rollout?
  • Do we need to add integration tests for this change in the graphql gateway?
  • Do we need a pollinator check for this?

@temaEmelyan temaEmelyan requested review from bbakerman and gnawf March 4, 2024 23:54
@temaEmelyan temaEmelyan self-assigned this Mar 4, 2024
Copy link

Thank you for your submission! Like many open source projects, we ask that you sign our CLA (Contributor License Agreement) before we can accept your contribution.
If your email is listed below, please ensure that you sign the CLA with the same email address.

The following users still need to sign our CLA:
❌artyomemelyanenko

Already signed the CLA? To re-check, try refreshing the page.

…ty-querries

# Conflicts:
#	lib/src/main/java/graphql/nadel/NadelExecutionHints.kt
#	lib/src/main/java/graphql/nadel/NextgenEngine.kt
gnawf
gnawf previously approved these changes Jun 6, 2024
}
val operationType = engineSchema.getTypeAs<GraphQLObjectType>(executableNormalizedField.singleObjectTypeName)
val topLevelFieldDefinition =
operationType.fieldDefinitions.firstOrNull { it.name == executableNormalizedField.name }
Copy link
Collaborator

Choose a reason for hiding this comment

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

getField(executableNormalizedField.name) ?

queryPath = underlyingParentField?.queryPath ?: NadelQueryPath.root,
flatten = true,
)
val parentNodes = JsonNodes(result.data)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should use the nodes param instead of creating a new one.

I mean it's test code so it doesn't matter but in reality we want to share one JsonNodes because it caches some JSON traversals.

@temaEmelyan temaEmelyan merged commit f95b257 into master Jun 13, 2024
2 checks passed
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.

2 participants