iTranslated by AI
The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🕌
Generate schema.graphql from a remote schema using @graphql-codegen/schema-ast
For example, when using graphql-eslint, I need this periodically but always forget how to do it, so here is a note.
Use @graphql-codegen/schema-ast.
The configuration is
codegen.json
{
"generates": {
"./graphql/generated/schema.graphql": {
"schema": "http://localhost:3000/api/graphql",
"plugins": ["schema-ast"]
}
}
}
something like this.
Discussion