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

FEATURE: flow query directy field access without get 0 #3399

Draft
wants to merge 2 commits into
base: 9.0
Choose a base branch
from

Conversation

mhsdesign
Copy link
Member

@mhsdesign mhsdesign commented Oct 11, 2024

The idea was to get rid of the unintuitive get(0) calls in cases were now we would like to fetch node fields directly like their identifier:

Currently:

q(node).parent().get(0).aggregateId

Proposed:

q(node).parent().aggregateId

The need for that was created as .property('_identifier') does not work anymore.

Further while we thought about this we came to the idea that all final operations - also the property operation could be replaced:

Currently:

q(node).parent().property('foo-bar')

Proposed:

q(node).parent().properties['foo-bar']

Upgrade instructions

Review instructions

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

q(node).parent().property('title')
vs q(node).parent().properties.title

at the moment only q(node).parent().get(0).properties.title would work
Fixes #2785

Previously `__get` was not handled and if `__call` was implemented only `__call` used.
@mhsdesign
Copy link
Member Author

i assume we need to discuss this further (see also the ideas from slack https://neos-project.slack.com/archives/C050KKBEB/p1728648485749549)

especially promoting q(node).properties.title would make integer arrays / lists like in Neos.Neos in flowquery first level citizen but a real array like q({foo: 'bar'}).foo would NOT work, as it would try to access foo on the first element: q({foo: {foo: 'value'}}).foo == value this is all a little odd and we have to see if we can live with that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant