Skip to content

Instantly share code, notes, and snippets.

@vegetablesalad
Last active October 1, 2018 10:58
Show Gist options
  • Save vegetablesalad/a2e6752748c3c020df2e8725cc5c6dd4 to your computer and use it in GitHub Desktop.
Save vegetablesalad/a2e6752748c3c020df2e8725cc5c6dd4 to your computer and use it in GitHub Desktop.
package.json for merging local and remote schemas + generate typings for typescript
{
"graphql": "yarn merge-graphql-schema;yarn generate-graphql-schema-json;yarn generate-graphql-schema-typings",
"merge-graphql-schema": "cd graphql;rm final.schema.graphql;get-graphql-schema http://my.remote.schema:3030/graphql > remote.merge.schema.graphql;gql merge **/*.graphql > final.schema.graphql",
"generate-graphql-schema-json": "cd graphql;apollo-codegen introspect-schema final.schema.graphql --output schema.json",
"generate-graphql-schema-typings": "cd graphql;gql-gen --schema schema.json --template typescript --out ../typings/graphql.d.ts;rm schema.json",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment