Skip to content

Commit

Permalink
chore(deps): update dependency prettier to v2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-martin committed May 12, 2021
1 parent 3754c28 commit fb6dc54
Show file tree
Hide file tree
Showing 63 changed files with 1,078 additions and 1,204 deletions.
14 changes: 4 additions & 10 deletions examples/auth/e2e/tag.resolver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1107,11 +1107,8 @@ describe('TagResolver (auth - e2e)', () => {
})
.expect(200)
.then(({ body }) => {
const {
edges,
pageInfo,
totalCount,
}: CursorConnectionType<TodoItemDTO> = body.data.addTodoItemsToTag.todoItems;
const { edges, pageInfo, totalCount }: CursorConnectionType<TodoItemDTO> =
body.data.addTodoItemsToTag.todoItems;
expect(body.data.addTodoItemsToTag.id).toBe('1');
expect(pageInfo).toEqual({
endCursor: 'YXJyYXljb25uZWN0aW9uOjQ=',
Expand Down Expand Up @@ -1181,11 +1178,8 @@ describe('TagResolver (auth - e2e)', () => {
})
.expect(200)
.then(({ body }) => {
const {
edges,
pageInfo,
totalCount,
}: CursorConnectionType<TodoItemDTO> = body.data.removeTodoItemsFromTag.todoItems;
const { edges, pageInfo, totalCount }: CursorConnectionType<TodoItemDTO> =
body.data.removeTodoItemsFromTag.todoItems;
expect(body.data.removeTodoItemsFromTag.id).toBe('1');
expect(pageInfo).toEqual({
endCursor: 'YXJyYXljb25uZWN0aW9uOjE=',
Expand Down
7 changes: 2 additions & 5 deletions examples/auth/e2e/todo-item.resolver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1614,11 +1614,8 @@ describe('TodoItemResolver (auth - e2e)', () => {
})
.expect(200)
.then(({ body }) => {
const {
edges,
pageInfo,
totalCount,
}: CursorConnectionType<SubTaskDTO> = body.data.addSubTasksToTodoItem.subTasks;
const { edges, pageInfo, totalCount }: CursorConnectionType<SubTaskDTO> =
body.data.addSubTasksToTodoItem.subTasks;
expect(body.data.addSubTasksToTodoItem.id).toBe('1');
expect(pageInfo).toEqual({
endCursor: 'YXJyYXljb25uZWN0aW9uOjU=',
Expand Down
6 changes: 2 additions & 4 deletions examples/federation/tag-graphql/e2e/tag.resolver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,8 @@ describe('Federated - TagResolver (e2e)', () => {
})
.expect(200)
.then(({ body }) => {
const {
edges,
pageInfo,
}: CursorConnectionType<TagTodoItemDTO & { todoItem: TodoItemReferenceDTO }> = body.data.tag.tagTodoItems;
const { edges, pageInfo }: CursorConnectionType<TagTodoItemDTO & { todoItem: TodoItemReferenceDTO }> =
body.data.tag.tagTodoItems;
expect(pageInfo).toEqual({
endCursor: 'YXJyYXljb25uZWN0aW9uOjE=',
hasNextPage: false,
Expand Down
6 changes: 4 additions & 2 deletions examples/hooks/src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ interface UpdatedBy {

@Injectable()
export class CreatedByHook<T extends CreatedBy>
implements BeforeCreateOneHook<T, GqlContext>, BeforeCreateManyHook<T, GqlContext> {
implements BeforeCreateOneHook<T, GqlContext>, BeforeCreateManyHook<T, GqlContext>
{
constructor(readonly authService: AuthService) {}

run(instance: CreateManyInputType<T>, context: GqlContext): Promise<CreateManyInputType<T>>;
Expand All @@ -46,7 +47,8 @@ export class CreatedByHook<T extends CreatedBy>

@Injectable()
export class UpdatedByHook<T extends UpdatedBy>
implements BeforeUpdateOneHook<T, GqlContext>, BeforeUpdateManyHook<T, T, GqlContext> {
implements BeforeUpdateOneHook<T, GqlContext>, BeforeUpdateManyHook<T, T, GqlContext>
{
constructor(readonly authService: AuthService) {}

run(instance: UpdateOneInputType<T>, context: GqlContext): Promise<UpdateOneInputType<T>>;
Expand Down
12 changes: 4 additions & 8 deletions examples/offset-paging/e2e/tag.resolver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -569,10 +569,8 @@ describe('TagResolver (limitOffset - e2e)', () => {
})
.expect(200)
.then(({ body }) => {
const {
id,
todoItems,
}: { id: string; todoItems: OffsetConnectionType<TodoItemDTO> } = body.data.addTodoItemsToTag;
const { id, todoItems }: { id: string; todoItems: OffsetConnectionType<TodoItemDTO> } =
body.data.addTodoItemsToTag;
expect(id).toBe('1');
expect(todoItems.nodes).toHaveLength(5);
expect(todoItems.nodes.map((e) => e.title).sort()).toEqual([
Expand Down Expand Up @@ -608,10 +606,8 @@ describe('TagResolver (limitOffset - e2e)', () => {
})
.expect(200)
.then(({ body }) => {
const {
id,
todoItems,
}: { id: string; todoItems: OffsetConnectionType<TodoItemDTO> } = body.data.removeTodoItemsFromTag;
const { id, todoItems }: { id: string; todoItems: OffsetConnectionType<TodoItemDTO> } =
body.data.removeTodoItemsFromTag;
expect(id).toBe('1');
expect(todoItems.nodes).toHaveLength(2);
expect(todoItems.nodes.map((e) => e.title).sort()).toEqual(['Create Entity', 'Create Nest App']);
Expand Down
6 changes: 2 additions & 4 deletions examples/offset-paging/e2e/todo-item.resolver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -658,10 +658,8 @@ describe('TodoItemResolver (limitOffset - e2e)', () => {
})
.expect(200)
.then(({ body }) => {
const {
id,
subTasks,
}: { id: string; subTasks: OffsetConnectionType<SubTaskDTO> } = body.data.addSubTasksToTodoItem;
const { id, subTasks }: { id: string; subTasks: OffsetConnectionType<SubTaskDTO> } =
body.data.addSubTasksToTodoItem;
expect(id).toBe('1');
expect(subTasks.nodes).toHaveLength(6);
subTasks.nodes.forEach((e) => expect(e.todoItemId).toBe('1'));
Expand Down
2 changes: 1 addition & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@types/passport-local": "1.0.33",
"@types/supertest": "2.0.11",
"jest": "26.6.3",
"prettier": "2.2.1",
"prettier": "2.3.0",
"supertest": "6.1.3",
"ts-jest": "26.5.6",
"ts-loader": "9.1.2",
Expand Down
14 changes: 4 additions & 10 deletions examples/sequelize/e2e/tag.resolver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -756,11 +756,8 @@ describe('TagResolver (sequelize - e2e)', () => {
})
.expect(200)
.then(({ body }) => {
const {
edges,
pageInfo,
totalCount,
}: CursorConnectionType<TodoItemDTO> = body.data.addTodoItemsToTag.todoItems;
const { edges, pageInfo, totalCount }: CursorConnectionType<TodoItemDTO> =
body.data.addTodoItemsToTag.todoItems;
expect(body.data.addTodoItemsToTag.id).toBe('1');
expect(pageInfo).toEqual({
endCursor: 'YXJyYXljb25uZWN0aW9uOjQ=',
Expand Down Expand Up @@ -805,11 +802,8 @@ describe('TagResolver (sequelize - e2e)', () => {
})
.expect(200)
.then(({ body }) => {
const {
edges,
pageInfo,
totalCount,
}: CursorConnectionType<TodoItemDTO> = body.data.removeTodoItemsFromTag.todoItems;
const { edges, pageInfo, totalCount }: CursorConnectionType<TodoItemDTO> =
body.data.removeTodoItemsFromTag.todoItems;
expect(body.data.removeTodoItemsFromTag.id).toBe('1');
expect(pageInfo).toEqual({
endCursor: 'YXJyYXljb25uZWN0aW9uOjE=',
Expand Down
7 changes: 2 additions & 5 deletions examples/sequelize/e2e/todo-item.resolver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1130,11 +1130,8 @@ describe('TodoItemResolver (sequelize - e2e)', () => {
})
.expect(200)
.then(({ body }) => {
const {
edges,
pageInfo,
totalCount,
}: CursorConnectionType<SubTaskDTO> = body.data.addSubTasksToTodoItem.subTasks;
const { edges, pageInfo, totalCount }: CursorConnectionType<SubTaskDTO> =
body.data.addSubTasksToTodoItem.subTasks;
expect(body.data.addSubTasksToTodoItem.id).toBe('1');
expect(pageInfo).toEqual({
endCursor: 'YXJyYXljb25uZWN0aW9uOjU=',
Expand Down
66 changes: 0 additions & 66 deletions examples/typegoose/e2e/todo-item.resolver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,72 +329,6 @@ describe('TodoItemResolver (typegoose - e2e)', () => {
]);
}));

// it(`should allow querying on subTasks`, () => {
// return request(app.getHttpServer())
// .post('/graphql')
// .send({
// operationName: null,
// variables: {},
// query: `{
// todoItems(filter: { subTasks: { title: { in: ["Create Nest App - Sub Task 1", "Create Entity - Sub Task 1"] } } }) {
// ${pageInfoField}
// ${edgeNodes(todoItemFields)}
// totalCount
// }
// }`,
// })
// .expect(200)
// .then(({ body }) => {
// const { edges, totalCount, pageInfo }: CursorConnectionType<TodoItemDTO> = body.data.todoItems;
// expect(pageInfo).toEqual({
// endCursor: 'eyJ0eXBlIjoia2V5c2V0IiwiZmllbGRzIjpbeyJmaWVsZCI6ImlkIiwidmFsdWUiOjJ9XX0=',
// hasNextPage: false,
// hasPreviousPage: false,
// startCursor: 'eyJ0eXBlIjoia2V5c2V0IiwiZmllbGRzIjpbeyJmaWVsZCI6ImlkIiwidmFsdWUiOjF9XX0=',
// });
// expect(totalCount).toBe(2);
// expect(edges).toHaveLength(2);
//
// expect(edges.map((e) => e.node)).toEqual([
// { id: '1', title: 'Create Nest App', completed: true, description: null, age: expect.any(Number) },
// { id: '2', title: 'Create Entity', completed: false, description: null, age: expect.any(Number) },
// ]);
// });
// });
//
// it(`should allow querying on tags`, () => {
// return request(app.getHttpServer())
// .post('/graphql')
// .send({
// operationName: null,
// variables: {},
// query: `{
// todoItems(filter: { tags: { name: { eq: "Home" } } }, sorting: [{field: id, direction: ASC}]) {
// ${pageInfoField}
// ${edgeNodes(todoItemFields)}
// totalCount
// }
// }`,
// })
// .expect(200)
// .then(({ body }) => {
// const { edges, totalCount, pageInfo }: CursorConnectionType<TodoItemDTO> = body.data.todoItems;
// expect(pageInfo).toEqual({
// endCursor: 'eyJ0eXBlIjoia2V5c2V0IiwiZmllbGRzIjpbeyJmaWVsZCI6ImlkIiwidmFsdWUiOjR9XX0=',
// hasNextPage: false,
// hasPreviousPage: false,
// startCursor: 'eyJ0eXBlIjoia2V5c2V0IiwiZmllbGRzIjpbeyJmaWVsZCI6ImlkIiwidmFsdWUiOjF9XX0=',
// });
// expect(totalCount).toBe(2);
// expect(edges).toHaveLength(2);
//
// expect(edges.map((e) => e.node)).toEqual([
// { id: '1', title: 'Create Nest App', completed: true, description: null, age: expect.any(Number) },
// { id: '4', title: 'Add Todo Item Resolver', completed: false, description: null, age: expect.any(Number) },
// ]);
// });
// });

it(`should allow sorting`, () =>
request(app.getHttpServer())
.post('/graphql')
Expand Down
14 changes: 4 additions & 10 deletions examples/typeorm/e2e/tag.resolver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -885,11 +885,8 @@ describe('TagResolver (typeorm - e2e)', () => {
})
.expect(200)
.then(({ body }) => {
const {
edges,
pageInfo,
totalCount,
}: CursorConnectionType<TodoItemDTO> = body.data.addTodoItemsToTag.todoItems;
const { edges, pageInfo, totalCount }: CursorConnectionType<TodoItemDTO> =
body.data.addTodoItemsToTag.todoItems;
expect(body.data.addTodoItemsToTag.id).toBe('1');
expect(pageInfo).toEqual({
endCursor: 'YXJyYXljb25uZWN0aW9uOjQ=',
Expand Down Expand Up @@ -934,11 +931,8 @@ describe('TagResolver (typeorm - e2e)', () => {
})
.expect(200)
.then(({ body }) => {
const {
edges,
pageInfo,
totalCount,
}: CursorConnectionType<TodoItemDTO> = body.data.removeTodoItemsFromTag.todoItems;
const { edges, pageInfo, totalCount }: CursorConnectionType<TodoItemDTO> =
body.data.removeTodoItemsFromTag.todoItems;
expect(body.data.removeTodoItemsFromTag.id).toBe('1');
expect(pageInfo).toEqual({
endCursor: 'YXJyYXljb25uZWN0aW9uOjE=',
Expand Down
7 changes: 2 additions & 5 deletions examples/typeorm/e2e/todo-item.resolver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1279,11 +1279,8 @@ describe('TodoItemResolver (typeorm - e2e)', () => {
})
.expect(200)
.then(({ body }) => {
const {
edges,
pageInfo,
totalCount,
}: CursorConnectionType<SubTaskDTO> = body.data.addSubTasksToTodoItem.subTasks;
const { edges, pageInfo, totalCount }: CursorConnectionType<SubTaskDTO> =
body.data.addSubTasksToTodoItem.subTasks;
expect(body.data.addSubTasksToTodoItem.id).toBe('1');
expect(pageInfo).toEqual({
endCursor: 'YXJyYXljb25uZWN0aW9uOjU=',
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"jest": "26.6.3",
"jest-extended": "0.11.5",
"lerna": "4.0.0",
"prettier": "2.2.1",
"prettier": "2.3.0",
"ts-jest": "26.5.6",
"tsconfig-extends": "1.0.1",
"typescript": "4.2.4"
Expand Down
17 changes: 4 additions & 13 deletions packages/core/__tests__/services/assembler-query.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ describe('AssemblerQueryService', () => {
objectContaining({ filter: { foo: { eq: 'bar' } } }),
),
).thenCall((relationClass, relation, entities) =>
Promise.resolve(
new Map<TestEntity, TestDTO[]>([[entities[0], [result]]]),
),
Promise.resolve(new Map<TestEntity, TestDTO[]>([[entities[0], [result]]])),
);
return expect(
assemblerService.queryRelations(TestDTO, 'test', [{ foo: 'bar' }], { filter: { foo: { eq: 'bar' } } }),
Expand Down Expand Up @@ -210,9 +208,7 @@ describe('AssemblerQueryService', () => {
aggQuery,
),
).thenCall((relationClass, relation, entities) =>
Promise.resolve(
new Map<TestEntity, AggregateResponse<TestDTO>>([[entities[0], result]]),
),
Promise.resolve(new Map<TestEntity, AggregateResponse<TestDTO>>([[entities[0], result]])),
);
return expect(
assemblerService.aggregateRelations(TestDTO, 'test', [{ foo: 'bar' }], { foo: { eq: 'bar' } }, aggQuery),
Expand Down Expand Up @@ -266,9 +262,7 @@ describe('AssemblerQueryService', () => {
when(
mockQueryService.countRelations(TestDTO, 'test', deepEqual([entity]), objectContaining({ foo: { eq: 'bar' } })),
).thenCall((relationClass, relation, entities) =>
Promise.resolve(
new Map<TestEntity, number>([[entities[0], 1]]),
),
Promise.resolve(new Map<TestEntity, number>([[entities[0], 1]])),
);
return expect(
assemblerService.countRelations(TestDTO, 'test', [{ foo: 'bar' }], { foo: { eq: 'bar' } }),
Expand All @@ -294,10 +288,7 @@ describe('AssemblerQueryService', () => {
const entity: TestEntity = { bar: 'bar' };
const result: TestDTO = { foo: 'baz' };
when(mockQueryService.findRelation(TestDTO, 'test', deepEqual([entity]), undefined)).thenCall(
(relationClass, relation, entities) =>
Promise.resolve(
new Map<TestEntity, TestDTO>([[entities[0], result]]),
),
(relationClass, relation, entities) => Promise.resolve(new Map<TestEntity, TestDTO>([[entities[0], result]])),
);
return expect(assemblerService.findRelation(TestDTO, 'test', [{ foo: 'bar' }])).resolves.toEqual(
new Map([[dto, result]]),
Expand Down
7 changes: 2 additions & 5 deletions packages/core/__tests__/services/noop-query.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ describe('NoOpQueryService', () => {
foo!: string;
}

const instance: QueryService<TestType> = NoOpQueryService.getInstance<
TestType,
DeepPartial<TestType>,
DeepPartial<TestType>
>();
const instance: QueryService<TestType> =
NoOpQueryService.getInstance<TestType, DeepPartial<TestType>, DeepPartial<TestType>>();

it('should throw a NotImplementedException when calling addRelations', () =>
expect(instance.addRelations('test', 1, [1, 2, 3])).rejects.toThrow('addRelations is not implemented'));
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/assemblers/abstract.assembler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { Assembler, getAssemblerClasses } from './assembler';
*
*/
export abstract class AbstractAssembler<DTO, Entity, C = DeepPartial<DTO>, CE = DeepPartial<Entity>, U = C, UE = CE>
implements Assembler<DTO, Entity, C, CE, U, UE> {
implements Assembler<DTO, Entity, C, CE, U, UE>
{
readonly DTOClass: Class<DTO>;

readonly EntityClass: Class<Entity>;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/assemblers/assembler.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ export class AssemblerFactory {
}
const defaultAssembler = new DefaultAssembler(DTOClass, EntityClass);
// if its a default just assume the types can be converted for all types
return (defaultAssembler as unknown) as Assembler<DTO, Entity, C, CE, U, UE>;
return defaultAssembler as unknown as Assembler<DTO, Entity, C, CE, U, UE>;
}
}
4 changes: 2 additions & 2 deletions packages/core/src/assemblers/assembler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface Assembler<
CreateDTO = DeepPartial<DTO>,
CreateEntity = DeepPartial<Entity>,
UpdateDTO = CreateDTO,
UpdateEntity = CreateEntity
UpdateEntity = CreateEntity,
> {
/**
* Convert an entity to a DTO
Expand Down Expand Up @@ -113,7 +113,7 @@ export function Assembler<
C = DeepPartial<DTO>,
CE = DeepPartial<Entity>,
U = DeepPartial<DTO>,
UE = DeepPartial<Entity>
UE = DeepPartial<Entity>,
>(DTOClass: Class<DTO>, EntityClass: Class<Entity>) {
return <Cls extends Class<Assembler<DTO, Entity, C, CE, U, UE>>>(cls: Cls): Cls | void => {
if (reflector.has(DTOClass, EntityClass)) {
Expand Down
Loading

0 comments on commit fb6dc54

Please sign in to comment.