mirror of
https://github.com/FranP-code/countries.git
synced 2025-10-13 00:02:15 +00:00
Indicate all non-null fields
This commit is contained in:
48
index.js
48
index.js
@@ -16,44 +16,44 @@ const typeDefs = gql`
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Continent {
|
type Continent {
|
||||||
code: ContinentCode
|
code: ContinentCode!
|
||||||
name: String
|
name: String!
|
||||||
countries: [Country]
|
countries: [Country!]!
|
||||||
}
|
}
|
||||||
|
|
||||||
type Country {
|
type Country {
|
||||||
code: CountryCode
|
code: CountryCode!
|
||||||
name: String
|
name: String!
|
||||||
native: String
|
native: String!
|
||||||
phone: String
|
phone: String!
|
||||||
continent: Continent
|
continent: Continent!
|
||||||
currency: String
|
currency: String!
|
||||||
languages: [Language]
|
languages: [Language!]!
|
||||||
emoji: String
|
emoji: String!
|
||||||
emojiU: String
|
emojiU: String!
|
||||||
states: [State]
|
states: [State!]!
|
||||||
}
|
}
|
||||||
|
|
||||||
type State {
|
type State {
|
||||||
code: String
|
code: String
|
||||||
name: String
|
name: String!
|
||||||
country: Country
|
country: Country!
|
||||||
}
|
}
|
||||||
|
|
||||||
type Language {
|
type Language {
|
||||||
code: LanguageCode
|
code: LanguageCode!
|
||||||
name: String
|
name: String
|
||||||
native: String
|
native: String
|
||||||
rtl: Boolean
|
rtl: Boolean!
|
||||||
}
|
}
|
||||||
|
|
||||||
type Query {
|
type Query {
|
||||||
continents: [Continent]
|
continents: [Continent!]!
|
||||||
continent(code: ContinentCode!): Continent
|
continent(code: ContinentCode!): Continent!
|
||||||
countries: [Country]
|
countries: [Country!]!
|
||||||
country(code: CountryCode!): Country
|
country(code: CountryCode!): Country!
|
||||||
languages: [Language]
|
languages: [Language!]!
|
||||||
language(code: LanguageCode!): Language
|
language(code: LanguageCode!): Language!
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@@ -153,6 +153,6 @@ const server = new ApolloServer({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
server.listen({port: process.env.PORT}).then(({url}) => {
|
server.listen({port: process.env.PORT || 4000}).then(({url}) => {
|
||||||
console.log(`🚀 Server ready at ${url}`);
|
console.log(`🚀 Server ready at ${url}`);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user