Skip to content

Instantly share code, notes, and snippets.

@Collin3
Collin3 / apoll-schema-check.sh
Last active February 20, 2023 19:08
Script to convert Apollo Schema Check JSON responses to markdown for github comments.
#!/usr/bin/env sh
set -euo pipefail
# Change the following line to refer to your graph ref, schema, and subgraph name
CHECK_OUTPUT=$(rover subgraph check my-graph --schema ./products.graphql --name products --output json)CHECK_SUCCESS=$(echo $CHECK_OUTPUT | jq '.data.success')
if [ $CHECK_SUCCESS = "true" ]; then
echo "### Status: :white_check_mark:"
echo ""
fi