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

7.x #5767

Open
wants to merge 378 commits into
base: dev
Choose a base branch
from
Open

7.x #5767

Changes from 1 commit
Commits
Show all changes
378 commits
Select commit Hold shift + click to select a range
91a8125
Update point filter operators
angrykoala Dec 9, 2024
fcb3a1e
add comments on filtering
angrykoala Dec 9, 2024
1e9373f
Merge pull request #5874 from neo4j/spatial-generic-filters
angrykoala Dec 9, 2024
84dca19
update filter operators
angrykoala Dec 9, 2024
1a9102a
Merge pull request #5875 from neo4j/update-filter-operators
angrykoala Dec 10, 2024
85a3eed
fix generic filtering when used within authorization rules
MacondoExpress Dec 10, 2024
72a0c82
Aggregation filters in schema
angrykoala Dec 10, 2024
5c7ba22
Add generic filters for aggregations
angrykoala Dec 11, 2024
6788e59
add support for authentication filtering with generic operators
MacondoExpress Dec 11, 2024
5345589
add language syntax highlighting
MacondoExpress Dec 11, 2024
896428b
Merge remote-tracking branch 'upstream/generic-scalar-filters' into c…
MacondoExpress Dec 11, 2024
5efd6e2
Merge pull request #5873 from MacondoExpress/cypher-relationship-quan…
MacondoExpress Dec 11, 2024
bae47ba
push minor changes left over from the relationship PR
MacondoExpress Dec 11, 2024
f80c39f
Merge branch 'generic-scalar-filters' into authorization-generic-filt…
MacondoExpress Dec 11, 2024
aa46120
update tests
MacondoExpress Dec 12, 2024
c11f69d
Remove lists from aggregation filter generation
angrykoala Dec 12, 2024
509a72f
Merge branch 'generic-scalar-filters' into aggregation-filters
angrykoala Dec 12, 2024
08c4320
Remove commented code
angrykoala Dec 12, 2024
75f63bf
clean-up PR
MacondoExpress Dec 12, 2024
7254acf
Deprecate old aggregation filters
angrykoala Dec 12, 2024
728e464
Merge pull request #5881 from MacondoExpress/authorization-generic-fi…
MacondoExpress Dec 12, 2024
55281f6
Update generic filters for custom scalars and enums
angrykoala Dec 12, 2024
0d655c8
fix authentication tests
MacondoExpress Dec 12, 2024
3f11cc8
change name from op to comparatorFunction
MacondoExpress Dec 13, 2024
ca8f643
Merge pull request #5885 from MacondoExpress/fix-authentication-tests
MacondoExpress Dec 13, 2024
3d0a0f8
Use shouldAddDeprecateFields utility
angrykoala Dec 13, 2024
8fcfe20
code review changes
angrykoala Dec 13, 2024
968a4d8
Merge pull request #5879 from neo4j/aggregation-filters
angrykoala Dec 13, 2024
c77d027
Merge pull request #5882 from neo4j/deprecate-old-aggregation-filters
angrykoala Dec 13, 2024
c20295e
Merge branch 'generic-scalar-filters' into enum-scalar-filters
angrykoala Dec 13, 2024
c890bb6
Add some filter tests on enum
angrykoala Dec 13, 2024
1a3915b
Merge pull request #5883 from neo4j/enum-scalar-filters
angrykoala Dec 13, 2024
ff647bf
WIP
MacondoExpress Dec 12, 2024
687f752
fix validation rules
MacondoExpress Dec 16, 2024
6afcadd
Validate plural conflicts in schema generation
angrykoala Dec 16, 2024
c880a3c
Merge branch 'dev' into 7.x
darrellwarde Dec 16, 2024
c6b0076
address PR comments
MacondoExpress Dec 16, 2024
3b3c5eb
Merge pull request #5894 from MacondoExpress/fix-validation-rules-gen…
MacondoExpress Dec 16, 2024
aa29046
Fix `7.x` branch (#5896)
darrellwarde Dec 16, 2024
bb85d0e
feat: always create on connect
mjfwebb Dec 13, 2024
5a92f95
test: update existing tests so they create new relationships
mjfwebb Dec 13, 2024
5493b42
test: add interface connect test
mjfwebb Dec 16, 2024
cae8eb6
test: update tck snapshots
mjfwebb Dec 16, 2024
cdf1061
test: add union connect test
mjfwebb Dec 16, 2024
2f0d00c
docs: add changeset
mjfwebb Dec 16, 2024
7100755
test: update snapshot
mjfwebb Dec 16, 2024
6e3cf86
test: update test descriptions
mjfwebb Dec 16, 2024
0f594fd
Merge pull request #5892 from mjfwebb/7x-connect-always-creates-new-r…
mjfwebb Dec 16, 2024
5f6a064
add relationsipFilters in excludeDeprecatedFields
MacondoExpress Dec 16, 2024
94432a7
update schema tests
MacondoExpress Dec 16, 2024
c59f2fe
update tests for attributeFiltering deprecation, and refactor style
MacondoExpress Dec 16, 2024
917482b
Create quick-dolphins-accept.md
MacondoExpress Dec 16, 2024
4f3b068
Create nine-games-clap.md
MacondoExpress Dec 16, 2024
8b1db7c
Apply suggestions from code review
MacondoExpress Dec 17, 2024
cba1a71
update changeset
MacondoExpress Dec 17, 2024
89e4cc5
Merge pull request #5897 from MacondoExpress/deprecate-non-generic-fi…
MacondoExpress Dec 17, 2024
af08d97
Merge remote-tracking branch 'upstream/7.x' into generic-scalar-filters
MacondoExpress Dec 17, 2024
c60b60e
update tests
MacondoExpress Dec 17, 2024
537badc
remove ID aggregation filters, respect the filter settings while gene…
MacondoExpress Dec 17, 2024
a912404
remove aggregation for ID fields
MacondoExpress Dec 17, 2024
cdff769
Merge pull request #5898 from MacondoExpress/refinement-aggregation-a…
MacondoExpress Dec 18, 2024
c07741c
fix lint errors
MacondoExpress Dec 18, 2024
92c46b9
Merge branch 'generic-scalar-filters' of github.com:neo4j/graphql int…
MacondoExpress Dec 18, 2024
853e065
add tests coverage around cypher filtering, fixed invalid List filter…
MacondoExpress Dec 18, 2024
f0c4e3d
Enter `7.x` into prerelease state
darrellwarde Dec 18, 2024
07ea342
Merge pull request #5900 from darrellwarde/chore/7.x-prerelease
darrellwarde Dec 19, 2024
3d93a18
Implement query complexity estimation (#5880)
a-alle Dec 19, 2024
85a206c
Merge pull request #5895 from neo4j/873-early-fail-on-name-collisions
MacondoExpress Dec 19, 2024
7335d8f
Undirected mutation behaviour when `queryDirection` is `UNDIRECTED` (…
darrellwarde Dec 19, 2024
376d907
Fix flaky test (#5902)
darrellwarde Dec 19, 2024
ed611f5
Merge remote-tracking branch 'upstream/dev' into 7.x
darrellwarde Dec 20, 2024
6e58320
fix cypher filtering many to many as authorizaiton with cypher filter…
MacondoExpress Dec 20, 2024
312a956
change input type name for generic relationship filters, by doing thi…
MacondoExpress Dec 20, 2024
0016759
Revert "Merge pull request #5892 from mjfwebb/7x-connect-always-creat…
mjfwebb Dec 20, 2024
30651f0
fix: linting error because of unnecessary type assertion
mjfwebb Dec 20, 2024
a650bb0
Merge pull request #5908 from mjfwebb/7x-revert-create-always-on-connect
mjfwebb Dec 20, 2024
9faf0f8
Merge branch 'dev' into 7.x
darrellwarde Dec 20, 2024
1d4dbec
Version Packages (alpha)
neo4j-team-graphql Dec 20, 2024
e1da36b
Merge pull request #5714 from neo4j/changeset-release/7.x
MacondoExpress Dec 20, 2024
524e951
Merge pull request #5907 from MacondoExpress/cypher-check
MacondoExpress Jan 2, 2025
07f6369
Merge branch 'dev' into 7.x
darrellwarde Jan 2, 2025
d1935ae
rename typename_IN to typename
MacondoExpress Jan 2, 2025
669eb12
update tests to convert typename_IN usage to typename
MacondoExpress Jan 2, 2025
530d8cd
Create clever-tomatoes-float.md
MacondoExpress Jan 2, 2025
6d3bf45
batch generic filtering tests migration tck 1
MacondoExpress Jan 2, 2025
af9f2d9
batch generic filtering tests migration tck 2 /tck/aggregations
MacondoExpress Jan 2, 2025
c685dba
batch generic filtering tests migration tck 3 /tck/connections
MacondoExpress Jan 2, 2025
f1003e2
batch generic filtering tests migration tck 4 /tck/operations
MacondoExpress Jan 2, 2025
81bd6bb
batch generic filtering tests migration tck 5 /tck/types
MacondoExpress Jan 2, 2025
94854f2
batch generic filtering tests migration tck 6 /tck/directives/authori…
MacondoExpress Jan 2, 2025
1997f3c
batch generic filtering tests migration tck 7 /tck/directives
MacondoExpress Jan 2, 2025
7aa94c7
batch generic filtering tests migration tck 8 /tck/subscriptions
MacondoExpress Jan 3, 2025
8573e00
batch generic filtering tests migration tck 9 mixed files
MacondoExpress Jan 3, 2025
1e976ca
batch generic filtering tests migration tck 10 mixed files
MacondoExpress Jan 3, 2025
87584a8
batch generic filtering tests migration tck 11 relationship filters
MacondoExpress Jan 3, 2025
aa582dd
batch generic filtering tests migration tck 12 relationship filters
MacondoExpress Jan 3, 2025
d8f7392
batch generic filtering tests migration tck 13 mixed missings
MacondoExpress Jan 3, 2025
99e2cda
batch generic filtering tests migration tck 14 mixed missings
MacondoExpress Jan 3, 2025
9fb133e
Merge pull request #5927 from MacondoExpress/typename
MacondoExpress Jan 3, 2025
dd35154
Merge pull request #5928 from MacondoExpress/add-test-coverage
MacondoExpress Jan 3, 2025
45ba0d5
Merge branch '7.x' into generic-scalar-filters
MacondoExpress Jan 3, 2025
bea8d6b
fix generic input filters for interface with different implementation
MacondoExpress Jan 3, 2025
548a529
Merge pull request #5929 from MacondoExpress/fix-interface-filters
MacondoExpress Jan 3, 2025
4a1aa86
Merge pull request #5836 from neo4j/generic-scalar-filters
MacondoExpress Jan 3, 2025
e5eb021
Version Packages (alpha)
neo4j-team-graphql Jan 3, 2025
3c10304
Merge pull request #5930 from neo4j/changeset-release/7.x
angrykoala Jan 6, 2025
6baca05
Merge branch 'dev' into 7.x
MacondoExpress Jan 9, 2025
8bdcf6b
Revert "Revert "Merge pull request #5892 from mjfwebb/7x-connect-alwa…
mjfwebb Jan 9, 2025
24102ca
fix always connect bug
MacondoExpress Jan 9, 2025
f10a964
test: update snapshots
mjfwebb Jan 9, 2025
188a767
Merge pull request #5933 from neo4j/revert-5908-7x-revert-create-alwa…
mjfwebb Jan 9, 2025
dd9a640
refactor: remove list of relationships case
mjfwebb Jan 7, 2025
7f5828a
test: add tests
mjfwebb Jan 7, 2025
486b1fb
feat: add distinct with to ReadOperation
mjfwebb Jan 9, 2025
7f63de4
test: update snapshots
mjfwebb Jan 10, 2025
d48ea32
docs: add changeset
mjfwebb Jan 10, 2025
b70c30f
test: update tests
mjfwebb Jan 13, 2025
138a334
test: update test
mjfwebb Jan 13, 2025
b0d8882
Merge remote-tracking branch 'upstream/dev' into 7.x
MacondoExpress Jan 13, 2025
f8baf03
remove unused code for ID aggregations
MacondoExpress Jan 13, 2025
5ce7d1d
Fix for inconsistent timezone handling (#5931)
darrellwarde Jan 13, 2025
01425f6
Update packages/graphql/tests/integration/directives/relationship/dup…
mjfwebb Jan 14, 2025
1eaabbe
Merge pull request #5936 from mjfwebb/7/dedupe-simple-relationships
mjfwebb Jan 14, 2025
0fc0ab3
docs: update comments
mjfwebb Jan 14, 2025
de25d9c
Merge pull request #5939 from MacondoExpress/clean-up-7-aggregation
MacondoExpress Jan 15, 2025
398cc1c
Merge branch 'dev' into 7.x
darrellwarde Jan 22, 2025
664e66e
Merge branch 'dev' into 7.x
angrykoala Jan 23, 2025
b70abdd
Merge remote-tracking branch 'origin/dev' into 7.x
angrykoala Jan 24, 2025
6d76424
Version Packages (alpha)
neo4j-team-graphql Jan 24, 2025
1a802c0
Merge pull request #5935 from neo4j/changeset-release/7.x
angrykoala Jan 24, 2025
737c555
Merge branch 'dev' into 7.x
angrykoala Jan 24, 2025
7bc73c2
add initial validation rule to help user identify a missed @node dire…
MacondoExpress Jan 16, 2025
c5e0b58
remove directives that in some shape or form are available outside ty…
MacondoExpress Jan 16, 2025
c14459a
initial refactor of validation rules for directives
MacondoExpress Jan 21, 2025
a35b13b
migrate coalesce validation to new structure
MacondoExpress Jan 23, 2025
a6ddf29
add default validation rule
MacondoExpress Jan 24, 2025
aaae82e
add fulltext validation rule
MacondoExpress Jan 24, 2025
8fa43d7
add limit directive validation to list of rules
MacondoExpress Jan 24, 2025
9cb5a3e
clean-up unused files
MacondoExpress Jan 24, 2025
a44c640
fix timestamp directive validation rule
MacondoExpress Jan 24, 2025
d70ca01
fix populatedBy/Timestamp validation rule
MacondoExpress Jan 24, 2025
b58165d
remove previous populatedBy validation rule
MacondoExpress Jan 24, 2025
233c23a
clean-up the new validation rules structure
MacondoExpress Jan 27, 2025
33fc67f
refactor naming on the Neo4jValidationContext
MacondoExpress Jan 27, 2025
68033a0
add neo4j copyright header to new files
MacondoExpress Jan 27, 2025
72c9f91
remove unused comment
MacondoExpress Jan 28, 2025
6189890
Merge remote-tracking branch 'upstream/dev' into 7.x
MacondoExpress Jan 28, 2025
0f47f28
Merge branch 'dev' into 7.x
angrykoala Jan 28, 2025
b5510f0
Merge remote-tracking branch 'upstream/aggregation-6' into aggregation-7
MacondoExpress Jan 28, 2025
7ddde75
Set cypherVersionPrefix default value to true
angrykoala Jan 29, 2025
a3a6129
Update execute unit tests
angrykoala Jan 29, 2025
bc11e95
apply suggestion from PR
MacondoExpress Jan 29, 2025
4ccb9c2
resolve PR comments
MacondoExpress Jan 29, 2025
0f5e618
apply PR suggestions
MacondoExpress Jan 29, 2025
d260966
add license header
MacondoExpress Jan 29, 2025
b1698b8
Merge pull request #5963 from MacondoExpress/validation-refactor
MacondoExpress Jan 29, 2025
00e3293
initial implementation
MacondoExpress Jan 30, 2025
6a5498d
wip, remove union from be generated as aggregation filters, update sc…
MacondoExpress Jan 30, 2025
953fd65
wip add first integration test
MacondoExpress Jan 30, 2025
a22b8f7
update aggregation/node tests to use aggregation filters inside conne…
MacondoExpress Jan 31, 2025
11fbf54
update aggregation/where/edge tests to use aggregation filters inside…
MacondoExpress Jan 31, 2025
13ec601
update tests to use new aggregate/generic operator syntax
MacondoExpress Jan 31, 2025
9ca08fc
refactor test count.int.test.ts and separate count-interface suite to…
MacondoExpress Feb 3, 2025
034b1fa
improve aggregation/top-level tests batch(1)
MacondoExpress Feb 5, 2025
1f2e47a
improve aggregation/top-level tests batch(2)
MacondoExpress Feb 5, 2025
af5b66e
add authorization filter test, for new aggregation
MacondoExpress Feb 5, 2025
3362063
add test coverage for authorization with aggregation rules and nested…
MacondoExpress Feb 6, 2025
dc8be5a
Merge pull request #5994 from MacondoExpress/aggregation-filters-insi…
MacondoExpress Feb 6, 2025
a716ef8
Remove method publish from subscription engines
angrykoala Feb 10, 2025
bfea7ef
Merge pull request #5997 from neo4j/remove-engine-publish
angrykoala Feb 11, 2025
d3fa604
Merge pull request #5976 from neo4j/set-default-cypherVersionPrefix
angrykoala Feb 11, 2025
e382d3b
added schema changes for aggregation count filters
MacondoExpress Feb 11, 2025
271a0a3
merge aggregation-6-into-aggregation-7
MacondoExpress Feb 11, 2025
3470dea
fix relationship adapter unit test
MacondoExpress Feb 11, 2025
09fe679
Merge pull request #6000 from MacondoExpress/merge-aggregation-6-into…
MacondoExpress Feb 11, 2025
9551284
update tests to support count nodes syntax
MacondoExpress Feb 11, 2025
d3fb0a9
update aggregation/tests to use the new count syntax
MacondoExpress Feb 12, 2025
e6bb032
fix old aggregate filtering syntax, add tests for it
MacondoExpress Feb 13, 2025
16e471d
implement and test aggregation count for edges, fixed count for nodes…
MacondoExpress Feb 14, 2025
4b1fbee
add .int suffix to count-edges.test.ts
MacondoExpress Feb 14, 2025
1a56515
add count-edges tck test
MacondoExpress Feb 14, 2025
55c897f
improve coverage over edges and distinct count
MacondoExpress Feb 14, 2025
48aec51
Merge pull request #6007 from neo4j/darrellwarde/transaction-metadata…
darrellwarde Feb 17, 2025
c7b02be
Merge remote-tracking branch 'origin/dev' into 7.x
angrykoala Feb 18, 2025
362f87e
Version Packages (alpha)
neo4j-team-graphql Feb 18, 2025
5667e6c
decouple count distinct fix
MacondoExpress Feb 18, 2025
de3ef63
update schema tests
MacondoExpress Feb 18, 2025
704ac20
Merge branch 'aggregation-7' into aggregation-filters-count
MacondoExpress Feb 18, 2025
7a40949
Merge pull request #6004 from MacondoExpress/aggregation-filters-count
MacondoExpress Feb 18, 2025
de7eae4
test difference between aggregation filters (legacy vs Connection) on…
MacondoExpress Feb 18, 2025
756ef0f
Merge pull request #5980 from neo4j/changeset-release/7.x
darrellwarde Feb 19, 2025
2aed967
add test coverage for aggregation rule on authorization
MacondoExpress Feb 19, 2025
02a09f0
fix count distinct
MacondoExpress Feb 20, 2025
3309bec
temporary fix localdatetime, types tests require some refactor.
MacondoExpress Feb 19, 2025
90005eb
extend temporary fix on localdatetime to deprecated tests
MacondoExpress Feb 20, 2025
03ee6e4
reintroduce wrongly removed skipped test
MacondoExpress Feb 20, 2025
0957fea
revert the aggregatio->node distinct, and added test for the differen…
MacondoExpress Feb 21, 2025
5a30d66
Merge pull request #6014 from MacondoExpress/extend-authorization-agg…
MacondoExpress Feb 24, 2025
f9bcae5
apply PR suggestions
MacondoExpress Feb 24, 2025
d99e63f
separate test files for 6005
MacondoExpress Feb 24, 2025
30f4960
Merge pull request #6018 from MacondoExpress/aggregation-filter-count…
MacondoExpress Feb 24, 2025
40ab466
Merge branch 'dev' into 7.x
MacondoExpress Feb 24, 2025
a869730
Merge branch 'dev' into 7.x
angrykoala Feb 24, 2025
aaa1009
add fix on future date also on deprecated files
MacondoExpress Feb 24, 2025
c3bed9c
Merge branch '7.x' of github.com:neo4j/graphql into 7.x
MacondoExpress Feb 24, 2025
2318336
add required changeset for aggregation filters changes in 7.x
MacondoExpress Feb 24, 2025
bf8bfc3
add deprecation for aggregation filter outside connection input
MacondoExpress Feb 24, 2025
eae6147
Merge remote-tracking branch 'origin/aggregation-6' into aggregation-7
angrykoala Feb 25, 2025
b9f493a
Fix subscription schema test
angrykoala Feb 25, 2025
65a995e
Merge pull request #6022 from neo4j/sync-aggregation
angrykoala Feb 25, 2025
7e18b7d
Merge remote-tracking branch 'origin/7.x' into aggregation-7
angrykoala Feb 25, 2025
c5651ec
Update tck test
angrykoala Feb 25, 2025
7af0fb2
fix authorization aggregation filter test
MacondoExpress Feb 25, 2025
1e9eaf1
Merge branch 'aggregation-7' of github.com:neo4j/graphql into aggrega…
MacondoExpress Feb 25, 2025
667e75c
add changeset and excludeDeprecatedFields option for aggregationFilte…
MacondoExpress Feb 25, 2025
5838f84
fix typo in the changeset summary
MacondoExpress Feb 25, 2025
aaf8938
fix typo
MacondoExpress Feb 25, 2025
01fb6b8
Merge remote-tracking branch 'origin/aggregation-6' into aggregation-7
angrykoala Feb 26, 2025
a9509f5
Update .changeset/silent-phones-sort.md
MacondoExpress Feb 26, 2025
fd7d373
WIP Deprecate aggregation fields
angrykoala Feb 26, 2025
2a28035
Merge remote-tracking branch 'origin/aggregation-6' into aggregation-7
angrykoala Feb 27, 2025
9057741
Merge branch 'aggregation-7' into remove-deprecated-aggregate
angrykoala Feb 27, 2025
58c2782
WIP fix aggregate tests
angrykoala Feb 27, 2025
b30c35e
Fix duplicate aggregation filters
angrykoala Feb 27, 2025
42de0c7
Refactor tests and improve solution on the filterable directive for a…
MacondoExpress Feb 27, 2025
3ee37b2
clean-up, add deprecation settings to improve coverage of the tests a…
MacondoExpress Feb 27, 2025
316ed2a
clean-up filterable logic
MacondoExpress Feb 27, 2025
f74374c
apply PR suggestion
MacondoExpress Feb 28, 2025
2b8a63c
Merge branch 'aggregation-7' into add-deprecations-and-changesets
MacondoExpress Feb 28, 2025
67375eb
update schema tests
MacondoExpress Feb 28, 2025
9e01391
Merge pull request #6024 from MacondoExpress/add-deprecations-and-cha…
MacondoExpress Feb 28, 2025
5fd563e
Merge branch 'aggregation-7' into schema-conf-for-aggregation-filters
MacondoExpress Feb 28, 2025
2cfe23c
Fix tck tests
angrykoala Feb 28, 2025
4f003a5
Remove isInConnection flag from queryAST
angrykoala Feb 28, 2025
11fa7ea
Remove top level resolver for aggregate
angrykoala Feb 28, 2025
b3a3d15
WIP cleanup of aggregation factory
angrykoala Feb 28, 2025
9ed5d12
keep generating aggregatiton filters if relationship.aggregate is set…
MacondoExpress Feb 28, 2025
faca4dd
Merge pull request #6030 from MacondoExpress/schema-conf-for-aggregat…
MacondoExpress Mar 3, 2025
7f3b17c
Update .changeset/quick-eagles-join.md
angrykoala Mar 3, 2025
3f6b8bb
Update schema tests
angrykoala Mar 3, 2025
fee3aaf
Merge remote-tracking branch 'origin/aggregation-7' into remove-depre…
angrykoala Mar 3, 2025
6a519cd
Merge pull request #6027 from neo4j/remove-deprecated-aggregate
angrykoala Mar 3, 2025
0cf27ac
Merge remote-tracking branch 'origin/dev' into 7.x
angrykoala Mar 7, 2025
c667618
Subscriptions as an opt-in feature (#6048)
darrellwarde Mar 10, 2025
8ef943e
Merge remote-tracking branch 'origin/7.x' into aggregation-7
angrykoala Mar 10, 2025
4329878
update yarn lock file
angrykoala Mar 10, 2025
68a0bc4
Merge pull request #6011 from neo4j/aggregation-7
angrykoala Mar 10, 2025
e421830
Merge remote-tracking branch 'origin/dev' into 7.x
angrykoala Mar 10, 2025
c5db901
Remove old skipped tests
angrykoala Mar 11, 2025
5a4e23f
Update CODEOWNERS (#6074)
mjfwebb Mar 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/aggregation-6' into aggregation-7
angrykoala committed Feb 25, 2025
commit eae6147281f4adde7a1d75a4bade7e7506a4907c
32 changes: 32 additions & 0 deletions .changeset/hot-bikes-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
"@neo4j/graphql": patch
---

Add count fields in aggregations with support for nodes and edges count:

```graphql
query {
moviesConnection {
aggregate {
count {
nodes
}
}
}
}
```

```graphql
query {
movies {
actorsConnection {
aggregate {
count {
nodes
edges
}
}
}
}
}
```
2 changes: 1 addition & 1 deletion .changeset/hot-windows-whisper.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
"@neo4j/graphql": minor
---

Add aggregate fieldd in connection:
Add aggregate field in connection:

```graphql
query {
2 changes: 1 addition & 1 deletion .changeset/sixty-steaks-reflect.md
Original file line number Diff line number Diff line change
@@ -2,4 +2,4 @@
"@neo4j/graphql": patch
---

Deprecate aggrgation fields (e.g `actedInAggregate`) in favor of the field `aggregate` inside the connection (e.g `actedInConnection -> aggregate`)
Deprecate aggregation fields (e.g `actedInAggregate`) in favor of the field `aggregate` inside the connection (e.g `actedInConnection -> aggregate`)
23 changes: 23 additions & 0 deletions packages/graphql/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -339,6 +339,29 @@

- [#5837](https://github.com/neo4j/graphql/pull/5837) [`721691a`](https://github.com/neo4j/graphql/commit/721691a84eaa34996c0c97edb7ede1ae4775dd2f) Thanks [@MacondoExpress](https://github.com/MacondoExpress)! - Added a validation rule to avoid defining fields as lists of nullable elements, as Neo4j does not support this.

## 6.3.1

### Patch Changes

- [#5952](https://github.com/neo4j/graphql/pull/5952) [`4e14680`](https://github.com/neo4j/graphql/commit/4e1468076bbd23cdd9156b039de1d03bbc68942c) Thanks [@angrykoala](https://github.com/angrykoala)! - Add `addVersionPrefix` to `cypherQueryOptions` in context to add a Cypher version with `CYPHER` before each query:

```js
{
cypherQueryOptions: {
addVersionPrefix: true,
},
}
```

This prepends all Cypher queries with a `CYPHER [version]` statement:

```cypher
CYPHER 5
MATCH (this:Movie)
WHERE this.title = $param0
RETURN this { .title } AS this
```

## 6.3.0

### Minor Changes
2 changes: 1 addition & 1 deletion packages/graphql/package.json
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@
"jest": "29.7.0",
"jest-extended": "4.0.2",
"jwks-rsa": "3.1.0",
"koa": "2.15.3",
"koa": "2.15.4",
"koa-jwt": "4.0.4",
"koa-router": "13.0.1",
"mock-jwks": "1.0.10",
2 changes: 1 addition & 1 deletion packages/graphql/src/graphql/objects/CartesianPoint.ts
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ export const CartesianPoint = new GraphQLObjectType({
},
srid: {
type: new GraphQLNonNull(GraphQLInt),
resolve: (source, args, context, info) => numericalResolver(source, args, context, info),
resolve: numericalResolver,
},
},
});
2 changes: 1 addition & 1 deletion packages/graphql/src/graphql/objects/Point.ts
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ export const Point = new GraphQLObjectType({
},
srid: {
type: new GraphQLNonNull(GraphQLInt),
resolve: (source, args, context, info) => numericalResolver(source, args, context, info),
resolve: numericalResolver,
},
},
});
Original file line number Diff line number Diff line change
@@ -131,10 +131,15 @@ export class ImplementingEntityOperations<T extends InterfaceEntityAdapter | Con
return `${this.entityAdapter.name}ImplementationsSubscriptionWhere`;
}

/** @deprecated use `getAggregateFieldTypename` instead */
public getAggregationFieldTypename(): string {
return this.aggregateTypeNames.selection;
}

public getAggregateFieldTypename(): string {
return this.aggregateTypeNames.selection;
}

public get rootTypeFieldNames(): RootTypeFieldNames {
return {
connection: `${this.entityAdapter.plural}Connection`,
Original file line number Diff line number Diff line change
@@ -38,7 +38,10 @@ export abstract class RelationshipBaseOperations<T extends RelationshipAdapter |

protected abstract get edgePrefix(): string;

/**Note: Required for now to infer the types without ResolveTree */
/**Note: Required for now to infer the types without ResolveTree
* @deprecated use getAggregateFieldTypename
*
*/
public getAggregationFieldTypename(nestedField?: "node" | "edge"): string {
const nestedFieldStr = upperFirst(nestedField || "");
const aggregationStr = nestedField ? "Aggregate" : "Aggregation";
@@ -47,6 +50,13 @@ export abstract class RelationshipBaseOperations<T extends RelationshipAdapter |
)}${nestedFieldStr}${aggregationStr}Selection`;
}

public getAggregateFieldTypename(nestedField?: "node" | "edge"): string {
const nestedFieldStr = upperFirst(nestedField || "");
return `${this.relationship.source.name}${this.relationship.target.name}${upperFirst(
this.relationship.name
)}${nestedFieldStr}AggregateSelection`;
}

public getTargetTypePrettyName(): string {
if (this.relationship.isList) {
return `[${this.relationship.target.name}!]${!this.relationship.isNullable ? "!" : ""}`;
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
* limitations under the License.
*/

import { GraphQLInt, GraphQLNonNull } from "graphql";
import type { ObjectTypeComposer, SchemaComposer } from "graphql-compose";
import type { Subgraph } from "../../classes/Subgraph";
import { numericalResolver } from "../resolvers/field/numerical";
@@ -25,16 +26,56 @@ export class AggregationTypesMapper {
private readonly aggregationSelectionTypes: Record<string, ObjectTypeComposer<unknown, unknown>>;

private readonly subgraph: Subgraph | undefined;
private readonly composer: SchemaComposer;

constructor(composer: SchemaComposer, subgraph?: Subgraph) {
this.subgraph = subgraph;
this.aggregationSelectionTypes = this.getOrCreateAggregationSelectionTypes(composer);
this.composer = composer;
}

public getAggregationType(typeName: string): ObjectTypeComposer<unknown, unknown> | undefined {
return this.aggregationSelectionTypes[typeName];
}

/** Top level count */
public getCountType(): ObjectTypeComposer {
const countFieldName = "Count";
const directives: string[] = this.subgraph ? [this.subgraph.getFullyQualifiedDirectiveName("shareable")] : [];
return this.composer.getOrCreateOTC(countFieldName, (countField) => {
countField.addFields({
nodes: {
type: new GraphQLNonNull(GraphQLInt),
resolve: numericalResolver,
},
});
for (const directiveName of directives) {
countField.setDirectiveByName(directiveName);
}
});
}

/** Nested count */
public getCountConnectionType(): ObjectTypeComposer {
const countFieldName = "CountConnection";
const directives: string[] = this.subgraph ? [this.subgraph.getFullyQualifiedDirectiveName("shareable")] : [];
return this.composer.getOrCreateOTC(countFieldName, (countField) => {
countField.addFields({
nodes: {
type: new GraphQLNonNull(GraphQLInt),
resolve: numericalResolver,
},
edges: {
type: new GraphQLNonNull(GraphQLInt),
resolve: numericalResolver,
},
});
for (const directiveName of directives) {
countField.setDirectiveByName(directiveName);
}
});
}

private getOrCreateAggregationSelectionTypes(
composer: SchemaComposer
): Record<string, ObjectTypeComposer<unknown, unknown>> {
Original file line number Diff line number Diff line change
@@ -79,6 +79,15 @@ export class FieldAggregationComposer {
);
}

this.composer.createObjectTC({
name: relationshipAdapter.operations.getAggregateFieldTypename(),
fields: {
count: this.aggregationTypesMapper.getCountConnectionType().NonNull,
...(aggregateSelectionNode ? { node: aggregateSelectionNode } : {}),
...(aggregateSelectionEdge ? { edge: aggregateSelectionEdge } : {}),
},
});

return this.composer.createObjectTC({
name: relationshipAdapter.operations.getAggregationFieldTypename(),
fields: {
35 changes: 21 additions & 14 deletions packages/graphql/src/schema/generation/aggregate-types.ts
Original file line number Diff line number Diff line change
@@ -91,26 +91,33 @@ function createConnectionAggregate({
composer: SchemaComposer;
features: Neo4jFeaturesSettings | undefined;
}): ObjectTypeComposer {
const aggregateNode = composer.createObjectTC({
name: entityAdapter.operations.aggregateTypeNames.node,
fields: {
count: {
type: new GraphQLNonNull(GraphQLInt),
resolve: numericalResolver,
args: {},
},
},
directives: graphqlDirectivesToCompose(propagatedDirectives),
});
aggregateNode.addFields(makeAggregableFields({ entityAdapter, aggregationTypesMapper, features }));
const aggregableFields = makeAggregableFields({ entityAdapter, aggregationTypesMapper, features });
let aggregateNode: ObjectTypeComposer | undefined;
const hasNodeAggregateFields = Object.keys(aggregableFields).length > 0;
if (hasNodeAggregateFields) {
aggregateNode = composer.createObjectTC({
name: entityAdapter.operations.aggregateTypeNames.node,
fields: {},
directives: graphqlDirectivesToCompose(propagatedDirectives),
});
aggregateNode.addFields(aggregableFields);
}

return composer.createObjectTC({
const connectionAggregate = composer.createObjectTC({
name: entityAdapter.operations.aggregateTypeNames.connection,
fields: {
node: aggregateNode.NonNull,
count: aggregationTypesMapper.getCountType().NonNull,
},
directives: graphqlDirectivesToCompose(propagatedDirectives),
});

if (aggregateNode) {
connectionAggregate.addFields({
node: aggregateNode.NonNull,
});
}

return connectionAggregate;
}

function makeAggregableFields({
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ export function withConnectionObjectType({

if (relationshipAdapter.isAggregable() && !isTargetUnion && !isSourceInterface) {
connectionObjectType.addFields({
aggregate: composer.getOTC(relationshipAdapter.operations.getAggregationFieldTypename()).NonNull,
aggregate: composer.getOTC(relationshipAdapter.operations.getAggregateFieldTypename()).NonNull,
});
}

Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ export class AggregationAttributeField extends AggregationField {
.return(projection);
}

return new Cypher.Return([this.getAggregationExpr(target), returnVar]);
return new Cypher.With(target).distinct().return([this.getAggregationExpr(target), returnVar]);
}

private createAggregationExpr(target: Cypher.Variable | Cypher.Property): Cypher.Expr {
Original file line number Diff line number Diff line change
@@ -24,10 +24,22 @@ import { AggregationField } from "./AggregationField";

export class CountField extends AggregationField {
private entity: Entity;
public edgeVar: Cypher.Variable | undefined;

constructor({ alias, entity }: { alias: string; entity: Entity }) {
private countFields: { nodes: boolean; edges: boolean };

constructor({
alias,
entity,
fields,
}: {
alias: string;
entity: Entity;
fields: { nodes: boolean; edges: boolean };
}) {
super(alias);
this.entity = entity;
this.countFields = fields;
}

public getChildren(): QueryASTNode[] {
@@ -39,10 +51,24 @@ export class CountField extends AggregationField {
}

public getAggregationExpr(variable: Cypher.Variable): Cypher.Expr {
return Cypher.count(variable);
return Cypher.count(variable).distinct();
}

public getAggregationProjection(target: Cypher.Variable, returnVar: Cypher.Variable): Cypher.Clause {
return new Cypher.Return([this.getAggregationExpr(target), returnVar]);
const resultMap = new Cypher.Map();

if (this.countFields.nodes) {
resultMap.set("nodes", this.getAggregationExpr(target));
}
if (this.countFields.edges) {
if (!this.edgeVar) {
throw new Error(
"Edge variable not defined in Count field. This is likely a bug with the GraphQL library."
);
}
resultMap.set("edges", this.getAggregationExpr(this.edgeVar));
}

return new Cypher.Return([resultMap, returnVar]);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) "Neo4j"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import Cypher from "@neo4j/cypher-builder";
import type { Entity } from "../../../../../schema-model/entity/Entity";
import type { QueryASTNode } from "../../QueryASTNode";
import { AggregationField } from "./AggregationField";

export class DeprecatedCountField extends AggregationField {
private entity: Entity;

constructor({ alias, entity }: { alias: string; entity: Entity }) {
super(alias);
this.entity = entity;
}

public getChildren(): QueryASTNode[] {
return [];
}

public getProjectionField(variable: Cypher.Variable): Record<string, Cypher.Expr> {
return { [this.alias]: variable };
}

public getAggregationExpr(variable: Cypher.Variable): Cypher.Expr {
return Cypher.count(variable);
}

public getAggregationProjection(target: Cypher.Variable, returnVar: Cypher.Variable): Cypher.Clause {
return new Cypher.Return([this.getAggregationExpr(target), returnVar]);
}
}
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.