From 37ea6fee9a021dbf2203ebc2b0e992bbc2c657af Mon Sep 17 00:00:00 2001 From: Anton Medvedev Date: Wed, 10 Jul 2024 23:52:27 +0200 Subject: [PATCH] Update README.md --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e693176..247ddb8 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,18 @@ Import generated code in your TypeScript file: ```ts import { IssuesQuery } from './query.graphql.js' -const { issues } = await octokit.graphql>(IssuesQuery) +// Use ReturnType to get the result type of the query. +type Result = ReturnType + +// IssuesQuery is a string with GraphQL query. +typeof IssuesQuery === 'string' +``` + +```ts +// Use Variables to get the variables type of the query. +import { Variables } from 'megaera' + +type InputVariables = Variables ``` ## FAQ