Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/21 implement graphql #33

Merged
merged 2 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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