@@ -3,6 +3,7 @@ import PLAYGROUND_HTML_TEMPLATE from "../assets/playground.html.tmpl" with { typ
33import { version } from "../../package.json" ;
44import { createGraphql } from "../graphql" ;
55import { z } from "zod/v4" ;
6+ import dedent from "dedent" ;
67
78const PLAYGROUND_HTML = PLAYGROUND_HTML_TEMPLATE . replace (
89 "{{VERSION}}" ,
@@ -27,19 +28,21 @@ export const graphqlRoutes = createApp()
2728 } )
2829 . meta ( {
2930 example : {
30- query : `query GetExtension($id: String!) {
31- chromeExtension(id: $id) {
32- id
33- screenshots { rawUrl }
34- }
35- }` ,
31+ query : dedent `
32+ query GetExtension($id: String!) {
33+ chromeExtension(id: $id) {
34+ id
35+ screenshots { rawUrl }
36+ }
37+ }
38+ ` ,
3639 variables : {
3740 id : "ocfdgncpifmegplaglcnglhioflaimkd" ,
3841 } ,
3942 operationName : "GetExtension" ,
4043 } ,
4144 } ) ,
42- response : z
45+ responses : z
4346 . object ( {
4447 data : z . any ( ) . optional ( ) ,
4548 errors : z . any ( ) . array ( ) . optional ( ) ,
@@ -69,11 +72,13 @@ export const graphqlRoutes = createApp()
6972 . get (
7073 "/playground" ,
7174 {
72- summary : "Playground " ,
75+ operationId : "playground " ,
7376 tags : [ "GraphQL" ] ,
74- description :
75- "Open the GraphiQL playground. This is where you can interact and test out the GraphQL API. It also contains the GraphQL documentation explorer." ,
76- response : z . string ( ) . meta ( { contentType : "text/html" } ) ,
77+ description : dedent `
78+ Open the GraphiQL playground. This is where you can interact and test out
79+ the GraphQL API. It also contains the GraphQL documentation explorer.
80+ ` ,
81+ responses : z . string ( ) . meta ( { contentType : "text/html" } ) ,
7782 } ,
7883 ( { set } ) => {
7984 set . headers [ "Content-Type" ] = "text/html; charset=utf-8" ;
0 commit comments