Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HaiderMalik12
Copy link

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • 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
  • No

Other information

@coveralls
Copy link

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

@kamilmysliwiec
Copy link
Member

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

@HaiderMalik12
Copy link
Author

HaiderMalik12 commented Aug 28, 2023 via email

@kamilmysliwiec
Copy link
Member

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)

@HaiderMalik12
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants