Is there a way to statically generate schema.json, #980
Replies: 1 comment 4 replies
-
As part of our CI/CD pipelines, I have a test that produces and verifies the schema definitions; developers need to update the SDL file in order for tests to pass. This ensures that changes to the schema are verified during development (upon PR approval), and I find that it also helps to verify nullability and naming of fields and types easily. It is easy enough to update the test so that it automatically updates the schema file if there is a change. This still allows the benefit of seeing changes to the schema within the PR for approval. I would imagine that it would be easy to update build scripts to use this file that was generated during tests. Assuming you only publish/build your project once tests pass, then the build would always have the correct schema file for use as you see fit. Assuming you have tests configured already, this might be very simple to implement. And assuming you have at least some tests configured, it should be rather simple to set up a schema test as I described. Perhaps you might need to mock some services which configuring the temp DI provider (e.g. If you'd like additional details on how I implemented this, lmk. |
Beta Was this translation helpful? Give feedback.
-
Hi there! I am running into an issue with how to work this library into our CICD pipelines.
We need to generate our schema file at build time, instead of at runtime, so that it can immediately be available to a client library that should build right after the server builds, so that we can deploy the client and server together.
I have been unable to find a way to have this happen. Does anyone know of a way that would allow us to, without launching our whole solution that requires dependencies like databases, run just enough of the program to have a schema file generated that we can consume during out build scripts?
Thanks so much!
Beta Was this translation helpful? Give feedback.
All reactions