diff --git a/README.md b/README.md index 4d4b3f6..684ffd7 100644 --- a/README.md +++ b/README.md @@ -714,6 +714,8 @@ One controller per trigger type can be used to have a more clear separation. For If you are using [GraphQL](https://graphql.org/) instead of controllers you will use [Resolvers](https://docs.nestjs.com/graphql/resolvers). +One of the main benefits of a layered architecture is separation of concerns. As you can see it doesn't matter if you use [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) or GraphQL, the only thing that changes is user-facing API layer (interface-adapters). All the application Core stays the same since it doesn't depend on technology you are using. + Example files: - [create-user.graphql-resolver.ts](src/modules/user/commands/create-user/create-user.graphql-resolver.ts) diff --git a/tests/user/create-user/create-user.artillery.yaml b/tests/user/create-user/create-user.artillery.yaml index a3f1ac3..6c71d72 100644 --- a/tests/user/create-user/create-user.artillery.yaml +++ b/tests/user/create-user/create-user.artillery.yaml @@ -3,7 +3,7 @@ # https://www.npmjs.com/package/artillery # https://www.npmjs.com/package/artillery-plugin-faker config: - target: http://localhost:3000 + target: http://localhost:3000/v1 phases: - duration: 1 arrivalRate: 50 diff --git a/tests/user/create-user/create-user.e2e-spec.ts b/tests/user/create-user/create-user.e2e-spec.ts index d04a700..7b90259 100644 --- a/tests/user/create-user/create-user.e2e-spec.ts +++ b/tests/user/create-user/create-user.e2e-spec.ts @@ -40,7 +40,7 @@ defineFeature(feature, test => { when('I send a request to create a user', async () => { const res = await httpServer - .post('/users') + .post('/v1/users') .send(userDto) .expect(201); userId = res.body; @@ -51,7 +51,7 @@ defineFeature(feature, test => { }); and('I can see my user in a list of all users', async () => { - const res = await httpServer.get('/users').expect(200); + const res = await httpServer.get('/v1/users').expect(200); expect(res.body).toMatchSnapshot([snapshotBaseProps]); expect(res.body.some((item: UserResponse) => item.id === userId.id)).toBe(