Closed SachaG closed 4 years ago
Also a bit related: https://github.com/VulcanJS/Vulcan/issues/2479, switching to Mongoose could allow us to export database schema too
You may want to check that this feature is safe in production, as creating a file may fail in rare case (permissions issue for example). It should either run only in dev or getGraphqlSchema
be wrapped in a try catch.
Also do you think it can run before the schema is made executable? See https://github.com/VulcanJS/Vulcan/issues/2536, currently debugging an invalid schema is tricky because it makes app startup failing and does not output the incriminated schema, so you have to log manually. It could be way easier to debug if we simply export a .graphql
file before trying to actually make it executable in Apollo.
Currently you can run
Vulcan.getGraphQLSchema()
to generate a singleschema.graphql
file that contains your entire GraphQL schema for debugging purposes. A nice and fairly easy way to improve this would be to: