No description, website, or topics provided.
Branch: master
Clone or download
Latest commit baf08e3 Jun 4, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
src
.gitignore
LICENSE
README.md
build.gradle
gradlew initial commit Jun 3, 2017
gradlew.bat
settings.gradle initial commit Jun 3, 2017

README.md

example project for graphql-contract-checker

It checks via

./gradlew checkContract

if the old contract is still valid. In this example it fails on purpose, because the old schema was:

type Query {
    hello: String
}

and the new one is

type Query {
    hello: Int
}

The type of hello was changed from String to Int which is a incompatible change.

Details

The graphql server is created with Apollo Lauchpad.

The main method executes the query {hello} against the server.

The old schema (as Introspection JSON) is saved in src/test/resources. The current query is available as classpath resource.

The gradle task to check the contract reads the old Introspection JSON file, reads the used query and queries the current Schema from the server.

With these three inputs the graphql-contract-checker is called and it is asserted that the contract is still valid.