Skip to content

Commit

Permalink
fix: set id not taking into account in set search
Browse files Browse the repository at this point in the history
Signed-off-by: Avior <[email protected]>
  • Loading branch information
Aviortheking committed Oct 17, 2024
1 parent 1a52a6f commit 4cd13b3
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
meta {
name: 562 - GraphQL set request is not returning the correct value
type: graphql
seq: 7
}

post {
url: {{BASE_URL}}/v2/graphql
body: graphql
auth: none
}

body:graphql {
query Pouet {
set(id: "{{SET_ID}}") {
id
}
}

}

vars:pre-request {
SET_ID: swsh1
}

assert {
res.status: eq 200
res.body.data.set.id: eq {{SET_ID}}
}
28 changes: 28 additions & 0 deletions .bruno/graphql/card.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
meta {
name: card
type: graphql
seq: 2
}

post {
url: {{BASE_URL}}/v2/graphql
body: graphql
auth: none
}

body:graphql {
query Pouet {
card(id: "{{ID}}") {
id
}
}
}

vars:pre-request {
ID: swsh1-136
}

assert {
res.status: eq 200
res.body.data.card.id: eq {{ID}}
}
2 changes: 1 addition & 1 deletion .bruno/graphql.bru → .bruno/graphql/cards.bru
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
meta {
name: GraphQL API
name: cards
type: graphql
seq: 1
}
Expand Down
29 changes: 29 additions & 0 deletions .bruno/graphql/serie.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
meta {
name: serie
type: graphql
seq: 5
}

post {
url: {{BASE_URL}}/v2/graphql
body: graphql
auth: none
}

body:graphql {
query Pouet {
serie(id: "{{ID}}") {
id
}
}

}

vars:pre-request {
ID: swsh
}

assert {
res.status: eq 200
res.body.data.serie.id: eq {{ID}}
}
24 changes: 24 additions & 0 deletions .bruno/graphql/series.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
meta {
name: series
type: graphql
seq: 6
}

post {
url: {{BASE_URL}}/v2/graphql
body: graphql
auth: none
}

body:graphql {
query Pouet {
series {
id
}
}

}

assert {
res.status: eq 200
}
29 changes: 29 additions & 0 deletions .bruno/graphql/set.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
meta {
name: set
type: graphql
seq: 3
}

post {
url: {{BASE_URL}}/v2/graphql
body: graphql
auth: none
}

body:graphql {
query Pouet {
set(id: "{{SET_ID}}") {
id
}
}

}

vars:pre-request {
SET_ID: swsh1
}

assert {
res.status: eq 200
res.body.data.set.id: eq {{SET_ID}}
}
24 changes: 24 additions & 0 deletions .bruno/graphql/sets.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
meta {
name: sets
type: graphql
seq: 4
}

post {
url: {{BASE_URL}}/v2/graphql
body: graphql
auth: none
}

body:graphql {
query Pouet {
sets {
id
}
}

}

assert {
res.status: eq 200
}
2 changes: 1 addition & 1 deletion server/src/V2/graphql/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const middleware = (fn: (lang: SupportedLanguages, query: Query<object>) => any)
// get the locale directive
const lang = getLang(e)

const query = recordToQuery(data.filters ?? {})
const query = recordToQuery(data.filters ?? data)

// Deprecated code handling
if (data.pagination) {
Expand Down

0 comments on commit 4cd13b3

Please sign in to comment.