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

221 lines
3.6 KiB
GraphQL

##################
# Global #
##################
# Locale Directive ex: {sets @locale(fr)}
directive @locale (
lang: String!
) on FIELD
"""
Every queries available on the GraphQL API
If you have more queries that you would like added, make a new issue here
https://github.com/tcgdex/cards-database/issues/new/choose
"""
type Query {
"""Find the cards"""
cards(filters: CardsFilters, pagination: Pagination, sort: Sort): [Card]
"""Find the sets"""
sets(filters: SetFilters, pagination: Pagination, sort: Sort): [Set]
"""Find the series"""
series(filters: SerieFilters, pagination: Pagination, sort: Sort): [Serie]
"""Find one card (using the id and set is deprecated)"""
card(
id: ID!,
set: String,
"""The new way to filter"""
filters: CardsFilters
): Card
"""Find one set (using the id is deprecated)"""
set(
id: ID!,
"""The new way to filter"""
filters: SetFilters
): Set
"""Find one serie (using the id is deprecated)"""
serie(
id: ID!,
"""The new way to filter"""
filters: SerieFilters
): Serie
}
"""Paginate the datas you fetch"""
input Pagination {
"""Indicate the page number (from 1)"""
page: Int!
"""Indicate the number of items in one page"""
itemsPerPage: Int
count: Float @deprecated(reason: "use itemsPerPage instead")
}
"""Change how the data is sorted"""
input Sort {
"""Indicate which field it will sort using"""
field: String!
"""Indicate how it is sorted ("ASC" or "DESC) (default: "ASC")"""
order: String
}
##################
# Card #
##################
# Filters to be used with the Card query
input CardsFilters {
category: String
description: String
energyType: String
evolveFrom: String
hp: Int
id: ID
localId: String
dexId: Int
illustrator: String
image: String
level: Int
levelId: String
name: String
rarity: String
regulationMark: String
stage: String
suffix: String
trainerType: String
retreat: Int
}
type Card {
abilities: [AbilitiesListItem]
attacks: [AttacksListItem]
category: String!
description: String
dexId: [Int]
effect: String
energyType: String
evolveFrom: String
hp: Int
id: String!
illustrator: String
image: String
item: Item
legal: Legal!
level: Int
localId: String!
name: String!
rarity: String!
regulationMark: String
resistances: [WeakResListItem]
retreat: Int
set: Set!
stage: String
suffix: String
trainerType: String
types: [String]
variants: Variants
weaknesses: [WeakResListItem]
# Currently not in any cards
# weight: String!
}
type AbilitiesListItem {
effect: String
name: String
type: String
}
type AttacksListItem {
cost: [String]
damage: String
effect: String
name: String!
}
type Item {
effect: String!
name: String!
}
type Legal {
expanded: Boolean
standard: Boolean
}
type WeakResListItem {
type: String!
value: String
}
type Variants {
firstEdition: Boolean!
holo: Boolean!
normal: Boolean!
reverse: Boolean!
wPromo: Boolean!
}
##################
# Set #
##################
type Set {
cardCount: CardCount!
cards: [Card]!
id: String!
logo: String
name: String!
symbol: String
serie: Serie!
releaseDate: String!
tcgOnline: String
}
input SetFilters {
id: String
name: String
serie: String
releaseDate: String
tcgOnline: String
}
type CardCount {
firstEd: Int
holo: Int
normal: Int
official: Int!
reverse: Int
total: Int!
}
##################
# Serie #
##################
type Serie {
id: String!
logo: String
name: String!
sets: [Set]!
}
input SerieFilters {
id: String
name: String
}
##################
# StringEndpoint #
##################
type StringEndpoint {
cards: [Card]!
name: String!
}