Skip to content

Commit

Permalink
Merge pull request #33 from coders-garden/feat/21-implement-graphql
Browse files Browse the repository at this point in the history
Feat/21 implement graphql
  • Loading branch information
PRATHAM1ST authored Sep 28, 2023
2 parents b378230 + b73d88e commit 0767979
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,16 @@ This route returns a JSON object containing details of a specific GitHub communi

```json
{
"query": "query { member(username: \"PRATHAM1ST\") { name github_link profile_pic_url bio } }"
"query": `
query {
member(username: "PRATHAM1ST") {
name
github_link
profile_pic_url
bio
}
}
`
// member(username: \"$github_username\")
}
```
Expand All @@ -155,7 +164,16 @@ This route returns a JSON object containing details of a specific GitHub communi

```json
{
"query": "query { members { name github_link profile_pic_url bio } }"
"query": `
query {
members {
name
github_link
profile_pic_url
bio
}
}
`
}
```

Expand Down Expand Up @@ -210,7 +228,14 @@ This route returns a JSON object containing details of a specific GitHub communi

```json
{
"query": "query { members { name bioData } }"
"query": `
query {
members {
name
bioData
}
}
`

// Note that bioData is a custom field that is not available in the database. It is a custom field that is created by the resolver.
}
Expand Down
4 changes: 2 additions & 2 deletions __tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe("POST /graphql - Specific Member", () => {
it("should return a specific member by login with name and username", async () => {
const query = `
query {
member(login: "PRATHAM1ST") {
member(username: "PRATHAM1ST") {
name
username
}
Expand All @@ -127,7 +127,7 @@ describe("POST /graphql - Specific Member", () => {
it("should return null for non-existent member", async () => {
const query = `
query {
member(login: "NonExistentUser") {
member(username: "NonExistentUser") {
name
username
}
Expand Down

0 comments on commit 0767979

Please sign in to comment.