{"slug":"schema-snapshot","title":"schema-snapshot","summary":"How the GraphQL schema is pinned by a snapshot test - schema.graphql in the integration tests, comparing it with /graphql?sdl, and updating it on purpose when the schema changes. Use when the schema snapshot test fails, or after adding or changing a query, mutation, type, field o","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-11-27T19:09:12.287464Z","repo":{"url":"https://github.com/LeanMeanCleanApps/CleanGraphQLApi","stars":13,"forks":7,"license":"MIT","updatedAt":"2026-11-25T23:23:22Z"},"bodyHtml":"<hr>\n<h2>name: schema-snapshot\ndescription: How the GraphQL schema is pinned by a snapshot test - schema.graphql in the integration tests, comparing it with /graphql?sdl, and updating it on purpose when the schema changes. Use when the schema snapshot test fails, or after adding or changing a query, mutation, type, field or description.\nmetadata:\nscope: presentation</h2>\n<h1>Schema snapshot</h1>\n<h2>The rule</h2>\n<p><code>tests/Presentation.Tests.Integration/GraphQL/Schema/schema.graphql</code> is the schema clients see, checked in. <code>SchemaTests.Schema_ShouldMatch_Snapshot</code> asks the running app for <code>/graphql?sdl</code> and fails when the two differ. Every schema change shows up in a pull request as a diff of that file, so reviewers see exactly what clients will see.</p>\n<p>The test ignores lines that start with <code>#</code>, which GraphQL treats as comments. In the template repository the snapshot uses them to mark the <code>ApplyPolicy</code> enum, which only exists when authorization is on, so <code>dotnet new</code> can leave it out of a solution created without <code>--include-auth</code>. Keep those markers when you update the snapshot there.</p>\n<h2>Steps</h2>\n<ol>\n<li>Make the schema change.</li>\n<li>Run the tests. The snapshot test fails and prints the new schema.</li>\n<li>Copy the new SDL into <code>schema.graphql</code>. Either take it from the test output, or run the app and open <a href=\"http://localhost:7330/graphql?sdl\">http://localhost:7330/graphql?sdl</a>.</li>\n<li>Read the diff. A removed field, a renamed one, or a field that became non-null breaks clients, so say so in the pull request.</li>\n<li>Run the tests again.</li>\n</ol>\n<h2>Don't</h2>\n<ul>\n<li>Update the snapshot without reading the diff.</li>\n<li>Edit <code>schema.graphql</code> by hand to make the test pass.</li>\n<li>Skip or delete the snapshot test.</li>\n</ul>\n<h2>Check</h2>\n<pre><code>dotnet test tests/Presentation.Tests.Integration --filter \"FullyQualifiedName~SchemaTests\"\ngit diff tests/Presentation.Tests.Integration/GraphQL/Schema/schema.graphql\n</code></pre>\n","files":[{"path":"SKILL.md","sizeBytes":1826,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-11-27T19:10:25.551616Z","sha256":"6D7D3D2CA23D006A422280776CEF0BB0B4156889A0D63FEA98466FABAF50EA71","sizeBytes":979},"review":null,"source":{"repositoryUrl":"https://github.com/LeanMeanCleanApps/CleanGraphQLApi","path":".agents/skills/schema-snapshot","license":"MIT","commit":"1168fead2e0c8143a44bdce3344e0ab5fe1db90a","subtreeSha":"7BCA55BB20DBD612D5794667289E76A805B2A11B9D963D7AC05F07AB55958FED","lastSyncedAt":"2026-11-27T19:09:06.789278Z"},"reviewedAt":"2026-11-27T19:12:56.333894Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/LeanMeanCleanApps/CleanGraphQLApi/tree/main/.agents/skills/schema-snapshot"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install leanmeancleanapps-cleangraphqlapi@llmmart"},{"target":"git","command":"git clone https://github.com/LeanMeanCleanApps/CleanGraphQLApi.git"}]}