-
-
Notifications
You must be signed in to change notification settings - Fork 349
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
[GraphQL] The consumer contract test fails always when the query has an input on the third-level #1167
Comments
Thanks for this. Could you please see if you can create a minimal version of this that suffers the same fate? Can you explain a bit further what you mean by "third level"? |
Regarding "third level" I mean items level:
Items have a filter by timeRange and status and I think it is the place which causes the 500 error. I have also tests for the queries like this:
and I do not have any issues with tests. But once again, if you compare these two queries there is only one difference - the level where the filter is used.
I hope it is more clear now. "Could you please see if you can create a minimal version of this that suffers the same fate?" |
From the new issue template: Think of it this way - as a maintainer, we have heaps on our plate. If you can create a github repo that we can clone that reproduces your issue, now all we need to do is focus on fixing the problem (or identifying the cause of the issue). Steps to reproduceHow can someone else reproduce this bug? Provide a Minimal, Reproducible Example. You can create your own repository, or use this template that's already hooked up to CI and everything. |
Ok, I will try to create a repo which you can use to reproduce the issue. But how do you test your releases? Looks like you do not check this case. |
you've probably answered your own question ;) there is a graphql example project, if your case isn't covered, you can add it in so that it
releases are tested in ci, you can see previous action runs |
We don't test every possible GraphQL query. GraphQL is just an abstraction over HTTP. The query property structure itself is not something Pact understands, but expects the request you sent to match what you configured in the test. Pact JS makes checking this a bit less brittle, by allowing additional whitespace. This is achieved through a regex. So it's possible the regex is not properly working across levels, although I suspect that's just coincidence and the issue is unrelated to levels. The repro will help us figure this out, and if tests need to be adjusted to prevent future regressions. |
Closing due to inactivity. |
Software versions
Please provide at least OS and version of pact-js
Issue Checklist
Please confirm the following:
Expected behaviour
I have a consumer contract test for a query with specific input. Please see the query example in the Steps. And the test fails always with 500 error code:
Actual behaviour
The test should pass. I added tests for another queries but they do not have the same input.
Steps to reproduce
I want to add a consumer contract test for graphql query.
Here is the example of the query:
I added the following tests:
The test fails always with 500 error.
The text was updated successfully, but these errors were encountered: