#!/bin/bash
yarn generate:types

changed=`git diff -- src/apollo/*/__generated__/* --exit-code`
if [ -n "$changed" ]; then
    echo "Please run 'yarn generate:types' to sync your code with the remote schema."
    echo "Change included below:"
    echo "$changed"
    echo "Please run 'yarn generate:types' to sync your code with the remote schema."
    exit -1
else
    echo "Your generated types are up to date."
fi
