Harris Lee
05/23/2022, 3:17 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Harris Lee
05/23/2022, 3:40 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Yousaf Nabi (pactflow.io)
Not currently tested, please feel free to help contribute or let us know if you want to see it!I’ve not used gQL for some years now on a project. On gQL -> OpenAPI https://github.com/schwer/graphql-to-openapi On the OpenAPI -> gQL, I have seen https://github.com/IBM/openapi-to-graphql Wonder if they might be worth having a play around with? Open to contributions to the pact-msw-adapter 🙌🏻
Matt (pactflow.io / pact-js / pact-go)
string, so now we have zero confidence that a given consumer query is compatible with a given provider (the other way around is much easier, as IBM have discovered)Matt (pactflow.io / pact-js / pact-go)
query scalarQuery (
$input: String!,
$otherInput: String!
) {
arrayOfStrings(input: $input, otherInput: $otherInput)
}
Is type as a string in the OAS. So now any non-empty query will pass a contract test, because it will satisfy stringHarris Lee
05/27/2022, 12:07 AMconsumer generate Pact using MSW adator, provider write provider side like CDCT and compare consumer generated pact.
the reason I want to do that is reusability from unit testing + contract in consumer side. so people easy to use
do you think it is good idea or not much getting benefit?Matt (pactflow.io / pact-js / pact-go)
Yousaf Nabi (pactflow.io)
Harris Lee
05/27/2022, 12:30 AMYousaf Nabi (pactflow.io)
jest-pact / mocha-pact dependant on your framework, or use pact-js directly, which is test framework agnostic, and you can use with whichever framework you are using.Matt (pactflow.io / pact-js / pact-go)
Harris Lee
05/27/2022, 12:31 AMHarris Lee
05/27/2022, 12:31 AMYousaf Nabi (pactflow.io)
pact-js with convenience options for jest. so you should be able to follow this post https://pactflow.io/blog/contract-testing-a-graphql-api/Yousaf Nabi (pactflow.io)
Harris Lee
05/27/2022, 12:33 AMprovider.addInteraction({
state: "Server is healthy",
uponReceiving: 'A request for API health',
willRespondWith: {
status: 200,
body: {
status: Matchers.like('up'),
},
},
withRequest: {
method: 'POST',
path: '/graphql',
},
})Harris Lee
05/27/2022, 12:33 AMwithQuery withVariable right?Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Harris Lee
05/27/2022, 12:36 AM