Implement a graphql query and resolver HTTP endpoint that allows the UI to retrieve the compiled schema from the admin server. The response should be in a form that triggers a browser download dialog with the supplied JSON and a filename 'schema.json'. I believe in express you can just use res.file.
There exists POC that should have all the relevant bits regarding the schema , but the feature should be implemented on the master branch.
To compile the schema something like this can be used: https://github.com/pb82/data-sync-ui/blob/schema-editor/server/gql/helper.js The query and resolver should be added here: https://github.com/aerogear/data-sync-ui/blob/master/server/gql/schema.js
Something like this can be used for sequelize to store the schema: https://github.com/pb82/data-sync-ui/blob/schema-editor/server/models/schema.js |
|