Skip to content

Commit

Permalink
Improve sortAndPaginationFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
angrykoala committed Mar 5, 2024
1 parent 295bd4a commit aa6c346
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
2 changes: 0 additions & 2 deletions packages/graphql/src/schema/make-augmented-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,6 @@ function generateObjectType({
graphqlDirectivesToCompose(propagatedDirectives)
);

// FOR CONCRETE
composer.Query.addFields({
[concreteEntityAdapter.operations.rootTypeFieldNames.connection]: rootConnectionResolver({
composer,
Expand Down Expand Up @@ -695,7 +694,6 @@ function generateInterfaceObjectType({
graphqlDirectivesToCompose(propagatedDirectives)
);

// FOR CONCRETE
composer.Query.addFields({
[interfaceEntityAdapter.operations.rootTypeFieldNames.connection]: rootConnectionResolver({
composer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,12 @@ export class ConnectionFactory {

// These sort fields will be duplicated on nested "CompositeConnectionPartial"

// TODO: this if shouldn't be needed
// if (relationship) {
this.hydrateConnectionOperationsASTWithSort({
entityOrRel: relationship ?? target,
resolveTree,
operation: compositeConnectionOp,
context,
});
// }
return compositeConnectionOp;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,6 @@ export class SortAndPaginationFactory {
entityOrRel: EntityAdapter | RelationshipAdapter,
context: Neo4jGraphQLTranslationContext
): { edge: Sort[]; node: Sort[] } {
if (isConcreteEntity(entityOrRel)) {
const nodeSortFields = this.createPropertySort({
optionArg: options.node ?? {},
entity: entityOrRel,
context,
});
return {
edge: [],
node: nodeSortFields,
};
}
if (isRelationshipEntity(entityOrRel)) {
const nodeSortFields = this.createPropertySort({
optionArg: options.node ?? {},
Expand All @@ -82,7 +71,6 @@ export class SortAndPaginationFactory {
node: nodeSortFields,
};
}
// Is union or interface

const nodeSortFields = this.createPropertySort({
optionArg: options.node ?? {},
Expand Down

0 comments on commit aa6c346

Please sign in to comment.