I'm not aware of any such tool. I'm not sure such a tool will exist, because
- retrieving data from GraphQL requires only the thinnest of layers over the existing GraphQL libraries, which are quite feature-rich
- the transformation/writing will likely be part of a different tool. I'm sure several tools for this already exist. The simplest example I could think of is Git. Getting a diff is as simple as running
git diff
after overwriting an existing version-controlled file.
A simple example of retrieving the data is adapted from the graphql-request
Documentation Quickstart
import { request, gql } from 'graphql-request'
import { writeFile } from 'fs/promises'
const query = gql`
{
Movie(title: "Inception") {
releaseDate
actors {
name
}
}
}
`
request('https://api.graph.cool/simple/v1/movies', query)
.then((data) => writeFile('data.json', data))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…