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

Support for graphql in e2e testing #3565

Open
t-zander opened this issue Feb 22, 2019 · 5 comments
Open

Support for graphql in e2e testing #3565

t-zander opened this issue Feb 22, 2019 · 5 comments
Labels
stage: ready for work The issue is reproducible and in scope type: enhancement Requested enhancement of existing feature

Comments

@t-zander
Copy link

t-zander commented Feb 22, 2019

Current behavior:

As far as I know there is no out of the box solution for stubbing graphQL requests.

With common api we can just do route('GET', 'someurl', dataToReturn)

Its really great and easy.

However, I can't find any clear, simple and documented solution to do something like this for graphQL. I understand that it may be a problem because it works differently.

But it could be great to have an ability to stub requests to graphQL.

Thank you

Desired behavior:

Want to have an easy and clear handling of graphQL stubbing.

@jennifer-shehane
Copy link
Member

There is a very large thread discussing workarounds here: cypress-io/cypress-documentation#122

But yes, we actually did not have a specific issue requesting support for GraphQL specifically. It's definitely on our Roadmap!

@cypress-bot cypress-bot bot added the stage: ready for work The issue is reproducible and in scope label Feb 25, 2019
@jennifer-shehane jennifer-shehane added type: enhancement Requested enhancement of existing feature difficulty: 5️⃣ labels Feb 25, 2019
@the-ult
Copy link

the-ult commented Sep 9, 2019

@jennifer-shehane any news on the roadmap about when/if graphql support will be integrated?

Is https://github.com/tgriesser/cypress-graphql-mock the way to go?

The problem (for me at least) is that the cypress-graphql-mock does not work with Apollo-angular (XHR) requests.

@tgriesser are you planning on integration apollo-angular (XHR) support as well? Your solutions seems promising, but I can't get it to work with Angular

@Jeff-Duke
Copy link

Jeff-Duke commented Mar 9, 2020

Just wanted to check the status/roadmap on this. is https://github.com/tgriesser/cypress-graphql-mock still being maintained? comments in cypress-io/cypress-documentation#122 seem to indicate others are not getting responses on that solution and are now forking and modifying the code to their needs. Is there a timeline for native GQL support in Cypress?

@tgriesser
Copy link
Member

We have a solution we've been iterating on internally for our own GraphQL development that we're hoping to open source sometime soon.

No specific timeline we can commit to, but it's something I personally would like to get released, especially since the cypress-graphql-mock linked has quite a few issues we've identified in our own usage.

@jrnail23
Copy link

@tgriesser, I'm of the aforementioned folks who have forked and modified your cypress-graphql-mock code, and I'd really like to hear more about the issues you've identified.
Also, I know you can't commit to anything specific, but can you provide a loose ballpark forecast (i.e., weeks, months, next year)?

I'm currently in the middle of adapting this stuff for our internal test tooling, but I'd hate to invest much more effort in this if it's about to change dramatically, or if we're building on top of something that might be fundamentally flawed.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: ready for work The issue is reproducible and in scope type: enhancement Requested enhancement of existing feature
Projects
None yet
Development

No branches or pull requests

6 participants