Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .changeset/breezy-cameras-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@neo4j/graphql": major
---

Remove aggregation fields for relationships to a single node (non-List relationships) - these serve no functional utility
274 changes: 134 additions & 140 deletions packages/graphql/src/schema/create-relationship-fields/index.ts

Large diffs are not rendered by default.

66 changes: 0 additions & 66 deletions packages/graphql/tests/schema/connect-or-create-id.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,6 @@ describe("connect or create with id", () => {
content: String!
createdAt: DateTime!
creator(directed: Boolean = true, options: UserOptions, where: UserWhere): User!
creatorAggregate(directed: Boolean = true, where: UserWhere): PostUserCreatorAggregationSelection
creatorConnection(after: String, directed: Boolean = true, first: Int, sort: [PostCreatorConnectionSort!], where: PostCreatorConnectionWhere): PostCreatorConnection!
id: ID!
}
Expand Down Expand Up @@ -583,18 +582,6 @@ describe("connect or create with id", () => {
id: ID!
}

input PostCreatorAggregateInput {
AND: [PostCreatorAggregateInput!]
NOT: PostCreatorAggregateInput
OR: [PostCreatorAggregateInput!]
count: Int
count_GT: Int
count_GTE: Int
count_LT: Int
count_LTE: Int
node: PostCreatorNodeAggregationWhereInput
}

input PostCreatorConnectFieldInput {
connect: UserConnectInput
\\"\\"\\"
Expand Down Expand Up @@ -651,48 +638,6 @@ describe("connect or create with id", () => {
create: PostCreatorCreateFieldInput
}

input PostCreatorNodeAggregationWhereInput {
AND: [PostCreatorNodeAggregationWhereInput!]
NOT: PostCreatorNodeAggregationWhereInput
OR: [PostCreatorNodeAggregationWhereInput!]
id_EQUAL: ID @deprecated(reason: \\"Aggregation filters that are not relying on an aggregating function will be deprecated.\\")
name_AVERAGE_EQUAL: Float @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_AVERAGE_GT: Float @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_AVERAGE_GTE: Float @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_AVERAGE_LENGTH_EQUAL: Float
name_AVERAGE_LENGTH_GT: Float
name_AVERAGE_LENGTH_GTE: Float
name_AVERAGE_LENGTH_LT: Float
name_AVERAGE_LENGTH_LTE: Float
name_AVERAGE_LT: Float @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_AVERAGE_LTE: Float @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_EQUAL: String @deprecated(reason: \\"Aggregation filters that are not relying on an aggregating function will be deprecated.\\")
name_GT: Int @deprecated(reason: \\"Aggregation filters that are not relying on an aggregating function will be deprecated.\\")
name_GTE: Int @deprecated(reason: \\"Aggregation filters that are not relying on an aggregating function will be deprecated.\\")
name_LONGEST_EQUAL: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_LONGEST_GT: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_LONGEST_GTE: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_LONGEST_LENGTH_EQUAL: Int
name_LONGEST_LENGTH_GT: Int
name_LONGEST_LENGTH_GTE: Int
name_LONGEST_LENGTH_LT: Int
name_LONGEST_LENGTH_LTE: Int
name_LONGEST_LT: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_LONGEST_LTE: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_LT: Int @deprecated(reason: \\"Aggregation filters that are not relying on an aggregating function will be deprecated.\\")
name_LTE: Int @deprecated(reason: \\"Aggregation filters that are not relying on an aggregating function will be deprecated.\\")
name_SHORTEST_EQUAL: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_SHORTEST_GT: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_SHORTEST_GTE: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_SHORTEST_LENGTH_EQUAL: Int
name_SHORTEST_LENGTH_GT: Int
name_SHORTEST_LENGTH_GTE: Int
name_SHORTEST_LENGTH_LT: Int
name_SHORTEST_LENGTH_LTE: Int
name_SHORTEST_LT: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_SHORTEST_LTE: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
}

type PostCreatorRelationship {
cursor: String!
node: User!
Expand Down Expand Up @@ -764,16 +709,6 @@ describe("connect or create with id", () => {
id: ID
}

type PostUserCreatorAggregationSelection {
count: Int!
node: PostUserCreatorNodeAggregateSelection
}

type PostUserCreatorNodeAggregateSelection {
id: IDAggregateSelectionNonNullable!
name: StringAggregateSelectionNonNullable!
}

input PostWhere {
AND: [PostWhere!]
NOT: PostWhere
Expand All @@ -797,7 +732,6 @@ describe("connect or create with id", () => {
createdAt_NOT: DateTime @deprecated(reason: \\"Negation filters will be deprecated, use the NOT operator to achieve the same behavior\\")
createdAt_NOT_IN: [DateTime!] @deprecated(reason: \\"Negation filters will be deprecated, use the NOT operator to achieve the same behavior\\")
creator: UserWhere
creatorAggregate: PostCreatorAggregateInput
creatorConnection: PostCreatorConnectionWhere
creatorConnection_NOT: PostCreatorConnectionWhere
creator_NOT: UserWhere
Expand Down
128 changes: 0 additions & 128 deletions packages/graphql/tests/schema/federation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ describe("Apollo Federation", () => {

type Post {
author: User!
authorAggregate(directed: Boolean = true, where: UserWhere): PostUserAuthorAggregationSelection
authorConnection(after: String, directed: Boolean = true, first: Int, sort: [PostAuthorConnectionSort!], where: PostAuthorConnectionWhere): PostAuthorConnection!
content: String!
}
Expand All @@ -120,18 +119,6 @@ describe("Apollo Federation", () => {
count: Int!
}

input PostAuthorAggregateInput {
AND: [PostAuthorAggregateInput!]
NOT: PostAuthorAggregateInput
OR: [PostAuthorAggregateInput!]
count: Int
count_GT: Int
count_GTE: Int
count_LT: Int
count_LTE: Int
node: PostAuthorNodeAggregationWhereInput
}

input PostAuthorConnectFieldInput {
connect: UserConnectInput
\\"\\"\\"
Expand Down Expand Up @@ -178,47 +165,6 @@ describe("Apollo Federation", () => {
create: PostAuthorCreateFieldInput
}

input PostAuthorNodeAggregationWhereInput {
AND: [PostAuthorNodeAggregationWhereInput!]
NOT: PostAuthorNodeAggregationWhereInput
OR: [PostAuthorNodeAggregationWhereInput!]
name_AVERAGE_EQUAL: Float @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_AVERAGE_GT: Float @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_AVERAGE_GTE: Float @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_AVERAGE_LENGTH_EQUAL: Float
name_AVERAGE_LENGTH_GT: Float
name_AVERAGE_LENGTH_GTE: Float
name_AVERAGE_LENGTH_LT: Float
name_AVERAGE_LENGTH_LTE: Float
name_AVERAGE_LT: Float @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_AVERAGE_LTE: Float @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_EQUAL: String @deprecated(reason: \\"Aggregation filters that are not relying on an aggregating function will be deprecated.\\")
name_GT: Int @deprecated(reason: \\"Aggregation filters that are not relying on an aggregating function will be deprecated.\\")
name_GTE: Int @deprecated(reason: \\"Aggregation filters that are not relying on an aggregating function will be deprecated.\\")
name_LONGEST_EQUAL: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_LONGEST_GT: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_LONGEST_GTE: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_LONGEST_LENGTH_EQUAL: Int
name_LONGEST_LENGTH_GT: Int
name_LONGEST_LENGTH_GTE: Int
name_LONGEST_LENGTH_LT: Int
name_LONGEST_LENGTH_LTE: Int
name_LONGEST_LT: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_LONGEST_LTE: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_LT: Int @deprecated(reason: \\"Aggregation filters that are not relying on an aggregating function will be deprecated.\\")
name_LTE: Int @deprecated(reason: \\"Aggregation filters that are not relying on an aggregating function will be deprecated.\\")
name_SHORTEST_EQUAL: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_SHORTEST_GT: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_SHORTEST_GTE: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_SHORTEST_LENGTH_EQUAL: Int
name_SHORTEST_LENGTH_GT: Int
name_SHORTEST_LENGTH_GTE: Int
name_SHORTEST_LENGTH_LT: Int
name_SHORTEST_LENGTH_LTE: Int
name_SHORTEST_LT: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_SHORTEST_LTE: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
}

type PostAuthorRelationship {
cursor: String!
node: User!
Expand Down Expand Up @@ -288,21 +234,11 @@ describe("Apollo Federation", () => {
content: String
}

type PostUserAuthorAggregationSelection {
count: Int!
node: PostUserAuthorNodeAggregateSelection
}

type PostUserAuthorNodeAggregateSelection {
name: StringAggregateSelectionNonNullable!
}

input PostWhere {
AND: [PostWhere!]
NOT: PostWhere
OR: [PostWhere!]
author: UserWhere
authorAggregate: PostAuthorAggregateInput
authorConnection: PostAuthorConnectionWhere
authorConnection_NOT: PostAuthorConnectionWhere
author_NOT: UserWhere
Expand Down Expand Up @@ -705,7 +641,6 @@ describe("Apollo Federation", () => {

type Post {
author: User!
authorAggregate(directed: Boolean = true, where: UserWhere): PostUserAuthorAggregationSelection
authorConnection(after: String, directed: Boolean = true, first: Int, sort: [PostAuthorConnectionSort!], where: PostAuthorConnectionWhere): PostAuthorConnection!
content: String!
}
Expand All @@ -715,18 +650,6 @@ describe("Apollo Federation", () => {
count: Int!
}

input PostAuthorAggregateInput {
AND: [PostAuthorAggregateInput!]
NOT: PostAuthorAggregateInput
OR: [PostAuthorAggregateInput!]
count: Int
count_GT: Int
count_GTE: Int
count_LT: Int
count_LTE: Int
node: PostAuthorNodeAggregationWhereInput
}

input PostAuthorConnectFieldInput {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties. Will default to \`false\` in 4.0.0.
Expand Down Expand Up @@ -770,47 +693,6 @@ describe("Apollo Federation", () => {
create: PostAuthorCreateFieldInput
}

input PostAuthorNodeAggregationWhereInput {
AND: [PostAuthorNodeAggregationWhereInput!]
NOT: PostAuthorNodeAggregationWhereInput
OR: [PostAuthorNodeAggregationWhereInput!]
name_AVERAGE_EQUAL: Float @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_AVERAGE_GT: Float @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_AVERAGE_GTE: Float @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_AVERAGE_LENGTH_EQUAL: Float
name_AVERAGE_LENGTH_GT: Float
name_AVERAGE_LENGTH_GTE: Float
name_AVERAGE_LENGTH_LT: Float
name_AVERAGE_LENGTH_LTE: Float
name_AVERAGE_LT: Float @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_AVERAGE_LTE: Float @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_EQUAL: String @deprecated(reason: \\"Aggregation filters that are not relying on an aggregating function will be deprecated.\\")
name_GT: Int @deprecated(reason: \\"Aggregation filters that are not relying on an aggregating function will be deprecated.\\")
name_GTE: Int @deprecated(reason: \\"Aggregation filters that are not relying on an aggregating function will be deprecated.\\")
name_LONGEST_EQUAL: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_LONGEST_GT: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_LONGEST_GTE: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_LONGEST_LENGTH_EQUAL: Int
name_LONGEST_LENGTH_GT: Int
name_LONGEST_LENGTH_GTE: Int
name_LONGEST_LENGTH_LT: Int
name_LONGEST_LENGTH_LTE: Int
name_LONGEST_LT: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_LONGEST_LTE: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_LT: Int @deprecated(reason: \\"Aggregation filters that are not relying on an aggregating function will be deprecated.\\")
name_LTE: Int @deprecated(reason: \\"Aggregation filters that are not relying on an aggregating function will be deprecated.\\")
name_SHORTEST_EQUAL: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_SHORTEST_GT: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_SHORTEST_GTE: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_SHORTEST_LENGTH_EQUAL: Int
name_SHORTEST_LENGTH_GT: Int
name_SHORTEST_LENGTH_GTE: Int
name_SHORTEST_LENGTH_LT: Int
name_SHORTEST_LENGTH_LTE: Int
name_SHORTEST_LT: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
name_SHORTEST_LTE: Int @deprecated(reason: \\"Please use the explicit _LENGTH version for string aggregation.\\")
}

type PostAuthorRelationship {
cursor: String!
node: User!
Expand Down Expand Up @@ -876,21 +758,11 @@ describe("Apollo Federation", () => {
content: String
}

type PostUserAuthorAggregationSelection {
count: Int!
node: PostUserAuthorNodeAggregateSelection
}

type PostUserAuthorNodeAggregateSelection {
name: StringAggregateSelectionNonNullable!
}

input PostWhere {
AND: [PostWhere!]
NOT: PostWhere
OR: [PostWhere!]
author: UserWhere
authorAggregate: PostAuthorAggregateInput
authorConnection: PostAuthorConnectionWhere
authorConnection_NOT: PostAuthorConnectionWhere
author_NOT: UserWhere
Expand Down
Loading