-
Notifications
You must be signed in to change notification settings - Fork 79
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
How to test/confirm federation implementation? #74
Comments
@kented I don't think the project has documentation in regards to that, probably the best approach you can take is integrating your API with the Apollo Gateway and test your queries and mutations. You can also query the |
Managed to test my changes. If it'd be helpful to others, I might be able to contribute some documentation in regard to what an rspec test could look like for apollo federation integration. |
@kented Would you mind sharing your approach? |
This is how I test the resolver for a model called 'User' in one of the apps I built:
I extracted this answer from a more complex test suite I wrote several months ago, so it may contain some errors. Hopefully it provides enough guidance to be helpful. The gem's test suite also has some examples you can see here: https://github.com/Gusto/apollo-federation-ruby/blob/master/spec/apollo-federation/entities_field_spec.rb#L164 |
Hi @kented , your approach was how I tested one of our internal app that's using federation. It works well but can be pretty confusing to someone who has less exposure to federation. But I do like that it creates a relatively honest test. Maybe in the future, the maintainers might consider some test helpers. For now, I'll try to add a PR that highlights this as a testing strategy, save future readers some time hopefully. |
Nice. I think what you've added to the README will be helpful to folks who are wondering how to test their implementation. |
Thanks for this gem, I think it will do just what I need. I've added the gem to my app and followed the steps for updating my schema and classes. Is there any documentation in regard to how I should test to confirm my changes?
The text was updated successfully, but these errors were encountered: