From 71895c380ddee8f09c2882c9055c706f53863dae Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Tue, 16 Jan 2024 12:21:37 +0000 Subject: [PATCH] examples: Update tsconfig.json in example --- .../schema/introspection.ts | 29 ++++++++++++++++++- examples/example-pokemon-api/tsconfig.json | 5 +--- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/examples/example-pokemon-api/schema/introspection.ts b/examples/example-pokemon-api/schema/introspection.ts index 436371c3..23b41824 100644 --- a/examples/example-pokemon-api/schema/introspection.ts +++ b/examples/example-pokemon-api/schema/introspection.ts @@ -1,4 +1,25 @@ -export const introspection = { +/** An IntrospectionQuery representation of your schema. + * + * @remarks + * This is an introspection of your schema saved as a file by GraphQLSP. + * You may import it to create a `graphql()` tag function with `gql.tada` + * by importing it and passing it to `initGraphQLTada<>()`. + * + * @example + * ``` + * import { initGraphQLTada } from 'gql.tada'; + * import type { introspection } from './introspection'; + * + * export const graphql = initGraphQLTada<{ + * introspection: typeof introspection; + * scalars: { + * DateTime: string; + * Json: any; + * }; + * }>(); + * ``` + */ +const introspection = { __schema: { queryType: { name: 'Query', @@ -412,7 +433,13 @@ export const introspection = { kind: 'SCALAR', name: 'Boolean', }, + { + kind: 'SCALAR', + name: 'Any', + }, ], directives: [], }, } as const; + +export { introspection }; diff --git a/examples/example-pokemon-api/tsconfig.json b/examples/example-pokemon-api/tsconfig.json index 5c4b930e..51dd5895 100644 --- a/examples/example-pokemon-api/tsconfig.json +++ b/examples/example-pokemon-api/tsconfig.json @@ -4,10 +4,7 @@ { "name": "@0no-co/graphqlsp", "schema": "./schema/schema.graphql", - "disableTypegen": true, - "shouldCheckForColocatedFragments": true, - "template": "graphql", - "templateIsCallExpression": true + "tadaOutputLocation": "./schema/introspection.ts" } ], "noEmit": true,