Skip to content

Commit

Permalink
chore(docs): add graphql example
Browse files Browse the repository at this point in the history
  • Loading branch information
gorillamoe committed Jul 16, 2024
1 parent aad5831 commit 6ebb042
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions docs/docs/usage/graphql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# GraphQL

Create a file with the `.http` extension and write your GraphQL requests in it.

## With variables

```http title="gql-with-variables.http"
# @graphql 1
POST https://swapi-graphql.netlify.app/.netlify/functions/index HTTP/1.1
accept: application/json
query Person($id: ID) {
person(personID: $id) {
name
}
}
variables { "id": 1 }
```

## Without variables

```http title="gql-without-variables.http"
# @graphql 1
POST https://swapi-graphql.netlify.app/.netlify/functions/index HTTP/1.1
accept: application/json
query Query {
allFilms {
films {
title
director
releaseDate
speciesConnection {
species {
name
classification
homeworld {
name
}
}
}
}
}
}
```

0 comments on commit 6ebb042

Please sign in to comment.