feat(data-schema): accept null to disable queryField for secondary indexes #567
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
There was previously no way to disable the top-level query field that was automatically created when a secondary index is created. This PR adds support for passing
null
as inindex(...).queryField(null)
to disable the query field. This is consistent with the configuration described since Gen1Issue number, if available:
#566
Changes
Corresponding docs PR, if applicable:
Validation
Unit tests have been included to validate a similar behaviour to Gen1
queryField('someName')
results in a query field called 'someName'queryField()
not called results in a query field with default namingqueryField(null)
results in the query field being set tonull
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.