Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

About

No description, website, or topics provided.

Resources

License

Releases

No releases published

Packages

No packages published

Languages