Skip to content

Commit

Permalink
docs(README): usage examples fixes (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
alundiak authored Nov 27, 2023
1 parent 15383e0 commit 0313fe9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const { repository } = await graphqlWithAuth(
⚠️ Do not use [template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) in the query strings as they make your code vulnerable to query injection attacks (see [#2](https://github.com/octokit/graphql.js/issues/2)). Use variables instead:

```js
const { lastIssues } = await graphql(
const { repository } = await graphql(
`
query lastIssues($owner: String!, $repo: String!, $num: Int = 3) {
repository(owner: $owner, name: $repo) {
Expand Down Expand Up @@ -168,10 +168,10 @@ const { lastIssues } = await graphql(

```js
const { graphql } = require("@octokit/graphql");
const { lastIssues } = await graphql({
const { repository } = await graphql({
query: `query lastIssues($owner: String!, $repo: String!, $num: Int = 3) {
repository(owner:$owner, name:$repo) {
issues(last:$num) {
repository(owner: $owner, name: $repo) {
issues(last: $num) {
edges {
node {
title
Expand Down

0 comments on commit 0313fe9

Please sign in to comment.