mirror of
https://github.com/FranP-code/countries.git
synced 2025-10-13 00:02:15 +00:00
Make the schema into a subgraph
This commit is contained in:
64
schema.graphql
Normal file
64
schema.graphql
Normal file
@@ -0,0 +1,64 @@
|
||||
type Continent @key(fields: "code") {
|
||||
code: ID!
|
||||
name: String!
|
||||
countries: [Country!]!
|
||||
}
|
||||
|
||||
type Country @key(fields: "code") {
|
||||
code: ID!
|
||||
name: String!
|
||||
native: String!
|
||||
phone: String!
|
||||
continent: Continent!
|
||||
capital: String
|
||||
currency: String
|
||||
languages: [Language!]!
|
||||
emoji: String!
|
||||
emojiU: String!
|
||||
states: [State!]!
|
||||
}
|
||||
|
||||
type State {
|
||||
code: String
|
||||
name: String!
|
||||
country: Country!
|
||||
}
|
||||
|
||||
type Language @key(fields: "code") {
|
||||
code: ID!
|
||||
name: String
|
||||
native: String
|
||||
rtl: Boolean!
|
||||
}
|
||||
|
||||
input StringQueryOperatorInput {
|
||||
eq: String
|
||||
ne: String
|
||||
in: [String]
|
||||
nin: [String]
|
||||
regex: String
|
||||
glob: String
|
||||
}
|
||||
|
||||
input CountryFilterInput {
|
||||
code: StringQueryOperatorInput
|
||||
currency: StringQueryOperatorInput
|
||||
continent: StringQueryOperatorInput
|
||||
}
|
||||
|
||||
input ContinentFilterInput {
|
||||
code: StringQueryOperatorInput
|
||||
}
|
||||
|
||||
input LanguageFilterInput {
|
||||
code: StringQueryOperatorInput
|
||||
}
|
||||
|
||||
type Query {
|
||||
continents(filter: ContinentFilterInput): [Continent!]!
|
||||
continent(code: ID!): Continent
|
||||
countries(filter: CountryFilterInput): [Country!]!
|
||||
country(code: ID!): Country
|
||||
languages(filter: LanguageFilterInput): [Language!]!
|
||||
language(code: ID!): Language
|
||||
}
|
||||
Reference in New Issue
Block a user