1
0
mirror of https://github.com/tcgdex/cards-database.git synced 2025-04-22 19:02:10 +00:00

fix: set id not taking into account in set search (#563)

This commit is contained in:
Florian Bouillon 2024-10-17 23:33:34 +02:00 committed by GitHub
parent 1a52a6f29a
commit 4c96331b93
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 165 additions and 2 deletions

View File

@ -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
.bruno/graphql/card.bru Normal file
View File

@ -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}}
}

View File

@ -1,5 +1,5 @@
meta {
name: GraphQL API
name: cards
type: graphql
seq: 1
}

29
.bruno/graphql/serie.bru Normal file
View File

@ -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
.bruno/graphql/series.bru Normal file
View File

@ -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
.bruno/graphql/set.bru Normal file
View File

@ -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
.bruno/graphql/sets.bru Normal file
View File

@ -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
}

View File

@ -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) {