nest icon indicating copy to clipboard operation
nest copied to clipboard

(feature) : Added a new sample project for GraphQL schema first testing

Open HaiderMalik12 opened this issue 10 months ago • 7 comments

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] The commit message follows our guidelines: https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md
  • [ ] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • [ ] Bugfix
  • [x] Feature
  • [ ] Code style update (formatting, local variables)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] CI related changes
  • [x] Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

I have added a new sample project on Graphql testing with the schema first approach.

Does this PR introduce a breaking change?

  • [ ] Yes
  • [X] No

Other information

HaiderMalik12 avatar Aug 25 '23 08:08 HaiderMalik12

Pull Request Test Coverage Report for Build 8f722235-919f-4c28-bb43-b40f2024ee87

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.513%

Totals Coverage Status
Change from base Build 5bd17c50-f4ca-40e5-b4dd-2c0c2dd7c586: 0.0%
Covered Lines: 6425
Relevant Lines: 6945

💛 - Coveralls

coveralls avatar Aug 25 '23 08:08 coveralls

Could we update one of the existing projects instead of adding yet another example?

kamilmysliwiec avatar Aug 28 '23 08:08 kamilmysliwiec

However you feel comfortable. Please let me know your thoughts on it

What would you prefer to do?

On Mon, Aug 28, 2023, 1:19 PM Kamil Mysliwiec @.***> wrote:

Could we update one of the existing projects instead of adding yet another example?

— Reply to this email directly, view it on GitHub https://github.com/nestjs/nest/pull/12281#issuecomment-1695249956, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD77J2RQPDX7R3MUWVGR2OTXXRIALANCNFSM6AAAAAA36E5Z4E . You are receiving this because you authored the thread.Message ID: @.***>

HaiderMalik12 avatar Aug 28 '23 08:08 HaiderMalik12

If we could add tests to this https://github.com/nestjs/nest/tree/master/sample/12-graphql-schema-first sample instead, that would be easier to maintain down the road (we already have plenty of samples in this repository)

kamilmysliwiec avatar Aug 28 '23 08:08 kamilmysliwiec

Thanks, I will do it

One more thing, Can I also write the documentation about Testing in GraphQL and Nest.js?

My idea is to write the documentation of my sample project into official Nest.js docs

What do you suggest?

HaiderMalik12 avatar Aug 28 '23 08:08 HaiderMalik12

Hey @kamilmysliwiec My example is using Postgres and TypeORM I could not find TypeORM and Postgres integration grahql-schema-first. Do you want me to add unit testing and integration testing without Postgres and TypeORM?

HaiderMalik12 avatar Sep 01 '23 09:09 HaiderMalik12

I have created a simple cats.services.spec.ts in grahql-schema-first. I am getting this error:

SyntaxError: /project/home/haidermalik12/workspace/src/cats/cats.service.spec.ts: Missing semicolon. (6:13)

      4 |
      5 | describe('CatsService', () => {
    > 6 |   let service: CatsService;
        |              ^
      7 |
      8 |   beforeEach(async () => {
      9 |     const module: TestingModule = await Test.createTestingModule({

@kamilmysliwiec Could you help?

Here is my source code: Github Repo Here is the codesandBox URL CodeSandBox

HaiderMalik12 avatar Sep 01 '23 10:09 HaiderMalik12