Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmedv committed Jul 10, 2024
1 parent 679ca31 commit 37ea6fe
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,18 @@ Import generated code in your TypeScript file:
```ts
import { IssuesQuery } from './query.graphql.js'

const { issues } = await octokit.graphql<ReturnType<IssuesQuery>>(IssuesQuery)
// Use ReturnType to get the result type of the query.
type Result = ReturnType<IssuesQuery>

// 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<IssuesQuery>
```
## FAQ
Expand Down

0 comments on commit 37ea6fe

Please sign in to comment.