Any examples of a react < - > serverless gra...
# pact-js
a
Any examples of a react < - > serverless graphql contract? Would I need to use async pact library like Message Pact? The app runs on an azure function using apolloHandler. It’s like react uses HTTP and the backend is more similar to a message service 😕
I could run
func start
before the tests to run the function locally but would be interested in a more unit testy solution
y
sharing this with the channel, as some useful links GraphQL plus thoughts around messaging examples I assume you've seen these 1. https://github.com/pact-foundation/pact-js/tree/master/examples/graphql 2. https://pactflow.io/blog/contract-testing-a-graphql-api/ 3. https://pact.canny.io/feature-requests/p/v3-support-for-graphql-interactions @Alan Boshier may have some input, he created a cool little script which I embarrassingly haven't tested out yet. If we could turn these somehow into a canonical example consumer / provider that would be ace we have some serverless examples and examples with kafka in JS that might help too Kafka • https://docs.pactflow.io/docs/examples/kafka/js/consumer/https://docs.pactflow.io/docs/examples/kafka/java/provider/ SAM • https://docs.pactflow.io/docs/examples/aws/sns/consumer/https://docs.pactflow.io/docs/examples/aws/sns/provider/ Serverless • https://github.com/pact-foundation/pact-js/tree/master/examples/serverless We'd like to ultimately pull out the examples from our repo, and it makes sense to build examples around a common scenario, so they scenarios are mix and match. If we think about hexagonal architecture, we should be able to demonstrate switching transport mechanisms or service providers easily (and testing them with Pact) whilst retaining our core business logic https://docs.pactflow.io/docs/examples#product-catalog-system-httpmessages Pact's Product store is essentially the equivalent of the Swagger PetStore but the added benefit of being an actual app. Although that is set to change in 2023 as we work together with the Swagger Open Source team. Some goodies going on at the moment • https://github.com/swagger-api/petstore-kafkahttps://swagger.io/blog/introducing-the-new-swagger-editor/ If the community wanted to support, one of the best ways would be to create a real world application even without Pact in it and present that as a little open source hack event to see the art of possible. I was surprised not to easily get a streetlights api from the asyncapi examples They got on our Killercoda flex and made one here https://www.asyncapi.com/docs/tutorials/streetlights-interactive We've got in on our Pact/OpenAPI/AsyncAPI closer aligned in the open source space, as well as driven by our commercial roadmap too, which should see good investment in both those spaces to help you all keep creating quality stuff This is go thinksters real world app, with added Pact https://github.com/drakulavich/realworld (thanks to @Anton Yakutovich for this!)
cc @Anton Yakutovich
a
Thanks for mentioning @Yousaf Nabi (pactflow.io) 👍 I described the details about realworld app example here https://dev.to/drakulavich/operation-pact-or-how-i-learned-to-stop-worrying-and-love-contract-testing-4nhh
🙌 1